It’s been days that I’m working on a project which I have to use convex hull in it, and specific method of graham scan. The problem has been solved till the place I want to sort the points.
So the story is that I have collected bunch of points which they are from the type Point and their coordinates are relatives. Mean they come from the mouse event x and y. So I have collected the mouse positions as x and y of the points. And I want to find the angle related to the pivot point. Does anyone have a piece of code to calculate that angle?
Many and many thanks, the image below is what I need:

It’s been days that I’m working on a project which I have to use
Share
Use
where
dyanddxrepresent the vertical and horizontal difference between the point and pivot point.A few notes to keep in mind:
The reference (0 radians) is by convention pointing to the right, not to the left as in your image. If you really want to measure it from the left, you’d have to do
Math.PI - angleto convert it.The
Math-trigonometry functions work in radians. To convert the results to degrees, you can useMath.toDegrees.In the mathematical world, increasing y-values point upwards. In your image, their pointing downwards.