/// <summary> /// 比较两个点是否重合 /// </summary> /// <param name="point2"></param> /// <param name="tolerance"> 用户指定的距离容差 </param> public bool IsAlmostEqualTo(XY point2, double tolerance) { return(this.DistanceTo(point2) <= tolerance); }
/// <summary> /// 比较两个点是否重合(容差为整个系统的容差 AngleTolerance) /// </summary> /// <param name="point2"></param> public bool IsAlmostEqualTo(XY point2) { return(this.DistanceTo(point2) <= VertexTolerance); }
/// <summary> 计算空间两个点的距离 </summary> /// <returns></returns> public double DistanceTo(XY node2) { return(Distance(this, node2)); }
/// <summary> 计算空间两个点的距离 </summary> /// <returns></returns> public static double Distance(XY point1, XY point2) { return((point1 - point2).GetLength()); }
public double DotProduct(XY vector2) { return(X * vector2.X + Y * vector2.Y); }
public double AngleTo(XY vector2) { return(Math.Acos(this.DotProduct(vector2) / GetLength() / vector2.GetLength())); }