I want to calculate angle from 3 points. Currently I can measure angles between 0-180. But I need to get angles from 0-360. How can i measure angles between 180-360?
int find_angle_from_cordinates_test(int ax,int ay,int bx,int by,int cx,int cy)
{
float sa = sqrt((cx-bx) * (cx-bx) + (cy - by)*(cy-by));
float sb = sqrt((cx-ax) * (cx-ax) + (cy - ay)*(cy-ay));
float sc = sqrt((ax-bx) * (ax-bx) + (ay - by)*(ay-by));
float aa = acosf((sb * sb + sc * sc - sa*sa)/(2 * sb * sc));
printf("Angle a : %f\n\r",(aa*180)/PI);
return (aa*180)/PI;
}
please note that (ax, ay) is center but not (0,0) and (bx,by), (cx,cy) can be any value in the circle.
Can anyone help me to find this?