/// <summary> /// Minimal degree between vectors /// </summary> public static float Angle(this PointF c1, PointF c2) { var a = c1.Angle() - c2.Angle(); a += (float)((a > PI) ? -2 * PI : (a < -PI) ? 2 * PI : 0); return(a); }
public static float Subtend(this PointF point, PointF a1, PointF a2) { a1 = a1.Subtract(point); a2 = a2.Subtract(point); float angleA = a1.Angle(), angleB = a2.Angle(); if (angleA > angleB) { float swap = angleA; angleA = angleB; angleB = swap; } return (float)((angleB - angleA + (Math.PI * 2)) % (Math.PI * 2)); }