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