First time here? Check out the FAQ!
x

Is there a simple and elegant way to convert Cartesian (XY) to Polar (AD or AR) ?

0 votes
246 views
Is there a Capytalk expression which would convert an XY co-ordinate to an equivalent Angle/Distance or Angle/Radius...
asked Nov 24, 2016 in Capytalk & Smalltalk by cristian-vogel (Master) (8,440 points)

1 Answer

+1 vote

The radius or distance would be:

(!x squared + !y squared) sqrt

The angle is arctan(y/x).  To see an example of how you can use the ArcTan module to compute the angle, see the Prototype called: MultichannelPan XY coordinates

answered Nov 24, 2016 by ssc (Savant) (128,160 points)
...