/// <summary> /// 计算一个点到直线的垂直距离 /// </summary> public static double PedalDistanceToLine(this Vector2d tarVector2d, Vector2d origin, Vector2d _direction) { Line2d line2D = new Line2d(origin, _direction); double dis = line2D.DistanceSquared(tarVector2d); return((double)Math.Sqrt(dis)); }
/// <summary> /// 计算一个点到直线的垂直距离 /// </summary> public static double CalcPedalDistanceToLine(this Vector2d tarVector2d, Line2d line2D) { double dis = line2D.DistanceSquared(tarVector2d); return((double)Math.Sqrt(dis)); }