Order points on a circle by directional angle

1.1k Views Asked by At

I have several points on a disk with radius of 150. I want to specify an angle and order the points based on the direction of that angle.

I know the coordinates of each point, and I can find the point on the edge of the circle to define the hypotenuse, but I just can't figure out how to get the distance to the perpendicular line "d"

image

After I calculate the distance of each point (light gray line), I can then order the points from least to greatest distance. I hope this makes sense.

click here to see result image

1

There are 1 best solutions below

2
On

I figured it out. I rotated the points around the origin(0,0) by (360-given angle). Then the distance to the edge of the disk is the radius (150) minus x. (r-x).