0
$\begingroup$

For my programm I have a section where I have to introduce coordinates for my prestressedsteel bars or cords and the associated area in Form of {{X1,Y1,Area1},{Xi,Yi,Areai}}.

For my further calculations I need to come back to the Radius which is in relation to the area of the steel. In the picture below you can see how I did the replacement of the area with the radius and how I got back to the radius for an Infinity-Number of bars. This solutions works but Graphics[] (This Function is used in my programm as well) don't like Transpose[] and my whole programm seems not to work anymore.

My Question:

Does someone now how I could replace the area with the radius without using Transpose[] or even without an intermediate step for an unknown amount of bars?

My existing Code

Thank you very much!

$\endgroup$
2
  • 2
    $\begingroup$ Please post copyable code, not images. People here want to experiment with the code without having to retype it. Moreover, you should consider to improve your question. I just did not get what your problem is. $\endgroup$ Commented Apr 7, 2020 at 14:46
  • $\begingroup$ You are right. I'll post the codes for my next question. $\endgroup$ Commented Apr 7, 2020 at 19:08

1 Answer 1

3
$\begingroup$
Prestressedsteel = {{50, 50, 314}, {150, 50, 1018}};

Change definition of v to

v = Round[N[Sqrt[#/Pi]], 0.01] &;

Then

PrestressedsteelwithRadius =
 {#[[1]], #[[2]], v[#[[3]]]} & /@ Prestressedsteel

(* {{50, 50, 10.}, {150, 50, 18.}} *)

Or

PrestressedsteelwithRadius =
 ReplacePart[#, 3 -> v[#[[3]]]] & /@ Prestressedsteel

(* {{50, 50, 10.}, {150, 50, 18.}} *)

Or

PrestressedsteelwithRadius =
 Join[Most[#], {v[Last[#]]}] & /@ Prestressedsteel

(* {{50, 50, 10.}, {150, 50, 18.}} *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.