Exemplo n.º 1
0
 /// <summary> Constructs and initializes a Point2f from the specified Point2f.</summary>
 /// <param name="p1">the Point2f containing the initialization x y data
 /// </param>
 public Point2f(Point2f p1) : base(p1)
 {
 }
Exemplo n.º 2
0
 /// <summary> Computes the L-1 (Manhattan) distance between this point and point p1.
 /// The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 public float distanceL1(Point2f p1)
 {
     return(System.Math.Abs(x - p1.x) + System.Math.Abs(y - p1.y));
 }
Exemplo n.º 3
0
 /// <summary> Computes the L-infinite distance between this point and point p1.
 /// The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 public float distanceLinf(Point2f p1)
 {
     return(System.Math.Max(System.Math.Abs(x - p1.x), System.Math.Abs(y - p1.y)));
 }
Exemplo n.º 4
0
 /// <summary> Computes the distance between this point and point p1.</summary>
 /// <param name="p1">the other point
 /// </param>
 public float distance(Point2f p1)
 {
     //UPGRADE_WARNING: Data types in Visual C# might be different.  Verify the accuracy of narrowing conversions. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1042'"
     return((float)System.Math.Sqrt(distanceSquared(p1)));
 }