Draw an arc between three points in xamarin android

I need to draw an arc for given three points, I calculated the center point as below,

float ab = (p1.Y - p2.Y) / (p1.X - p2.X); float bc = (p3.Y - p2.Y) / (p3.X - p2.X);

                float xctr = (ab * bc * (p3.Y - p1.Y) + ab * (p2.X + p3.X) - bc * (p1.X + p2.X)) / (2 * (ab - bc));

                float yctr = -(1 / ab) * (xctr - ((p1.X + p2.X) / 2)) + ((p1.Y + p2.Y) / 2);

                float rad = (nfloat)Math.Sqrt(Math.Pow(p1.X - xctr, 2) + Math.Pow(p1.Y - yctr, 2));

      

Now I need to draw an arc based on these points.

Any suggestion on this would be appreciated!

+3


source to share





All Articles