XY Point to Polar

I feel like I’m going in circles here…

I’m trying to get the degree from an XY point, I’m aware of the to Polar command but that seems to be in 3D?

I know I can get the polar coordinated by tan^1(y/x) but I would need to add 180 or 360 if it was in quadrant 2,3 or 4. I was going to run this through a C# component to handle the quadrant issue.

This seems way overkill and I must be missing something?



Atan is not enough, you need Atan2.

If both x and y were the opposite sign, the fraction would have the same value, which means Atan can’t tell the difference between opposite directions. Atan2 takes 2 arguments, and therefore can.

You can use a python component with atan2:

from math import atan2
R = atan2(y,x)