/// <summary> /// Normal from the line to the point /// </summary> public static PointF Normal(this PointF direction, PointF point) { var cosAngle = (point.X * direction.X + point.Y * direction.Y) / direction.LengthSquare(); var x = direction.X * cosAngle; var y = direction.Y * cosAngle; return(new PointF(point.X - x, point.Y - y)); }