math - How calc angle of sectors by two points, radius, center of circle -


how calc angle of sectors 2 points, radius, center of circle. try this: (p1,p2 - points in circle, center - center of circle)

startangle = (int)(180 / mathf.pi * mathf.atan2(p1.y - center.y, p1.x - center.x)); endangle = (int)(180 / mathf.pi * mathf.atan2(p2.y - center.y, p2.x - center.x)); 

what have looks me, assuming want measure angles in degrees anticlockwise x axis.

here in latex, subscript 0 quantities being centre of circle.


Comments