public static double GetAngle(this Point point) { if (point.Y == 0) { return(point.X < 0 ? Math.PI : 0); } if (point.X == 0) { return(point.Y < 0 ? -Math.PI / 2 : Math.PI / 2); } return(Math.Sign(point.Y) * Math.Acos(point.X / point.GetLength())); }