Exemplo n.º 1
0
 /// <summary> Multiplies each of the x,y,z components of the Point4f parameter
 /// by 1/w and places the projected values into this point.
 /// </summary>
 /// <param name="p1">the source Point4d, which is not modified
 /// </param>
 public void  project(Point4f p1)
 {
     // zero div may occur.
     x = p1.x / p1.w;
     y = p1.y / p1.w;
     z = p1.z / p1.w;
 }
Exemplo n.º 2
0
        /// <summary> Computes the square of the distance between this point and point p1.</summary>
        /// <param name="p1">the other point
        /// </param>
        /// <returns> the square of distance between these two points as a float
        /// </returns>
        public float distanceSquared(Point4f p1)
        {
            double dx = x - p1.x;
            double dy = y - p1.y;
            double dz = z - p1.z;
            double dw = w - p1.w;

            //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)(dx * dx + dy * dy + dz * dz + dw * dw));
        }
Exemplo n.º 3
0
 /// <summary> Constructs and initializes a Point4f from the specified Point4f.</summary>
 /// <param name="p1">the Point4f containing the initialization x y z w data
 /// </param>
 public Point4f(Point4f p1) : base(p1)
 {
 }
Exemplo n.º 4
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), abs(z1-z2), abs(w1-w2)].
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 /// <returns> L-infinite distance
 /// </returns>
 public float distanceLinf(Point4f p1)
 {
     return(System.Math.Max(System.Math.Max(System.Math.Abs(x - p1.x), System.Math.Abs(y - p1.y)), System.Math.Max(System.Math.Abs(z - p1.z), System.Math.Abs(w - p1.w))));
 }
Exemplo n.º 5
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)
 /// + abs(z1-z2) + abs(w1-w2).
 /// </summary>
 /// <param name="p1">the other point
 /// </param>
 /// <returns> L-1 distance
 /// </returns>
 public float distanceL1(Point4f p1)
 {
     return(System.Math.Abs(x - p1.x) + System.Math.Abs(y - p1.y) + System.Math.Abs(z - p1.z) + System.Math.Abs(w - p1.w));
 }
Exemplo n.º 6
0
 /// <summary> Returns the distance between this point and point p1.</summary>
 /// <param name="p1">the other point
 /// </param>
 /// <returns> the distance between these two points
 /// </returns>
 public float distance(Point4f 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)));
 }
Exemplo n.º 7
0
		/// <summary> Multiplies each of the x,y,z components of the Point4f parameter by 1/w,
		/// places the projected values into this point, and places a 1 as the w
		/// parameter of this point.
		/// </summary>
		/// <param name="p1">the source Point4d, which is not modified
		/// </param>
		public void  project(Point4f p1)
		{
			// zero div may occur.
			x = p1.x / p1.w;
			y = p1.y / p1.w;
			z = p1.z / p1.w;
			w = 1.0f;
		}
Exemplo n.º 8
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), abs(z1-z2), abs(w1-w2)].
		/// </summary>
		/// <param name="p1">the other point
		/// </param>
		/// <returns> L-infinite distance
		/// </returns>
		public float distanceLinf(Point4f p1)
		{
			return System.Math.Max(System.Math.Max(System.Math.Abs(x - p1.x), System.Math.Abs(y - p1.y)), System.Math.Max(System.Math.Abs(z - p1.z), System.Math.Abs(w - p1.w)));
		}
Exemplo n.º 9
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)
		/// + abs(z1-z2) + abs(w1-w2).
		/// </summary>
		/// <param name="p1">the other point
		/// </param>
		/// <returns> L-1 distance
		/// </returns>
		public float distanceL1(Point4f p1)
		{
			return System.Math.Abs(x - p1.x) + System.Math.Abs(y - p1.y) + System.Math.Abs(z - p1.z) + System.Math.Abs(w - p1.w);
		}
Exemplo n.º 10
0
		/// <summary> Returns the distance between this point and point p1.</summary>
		/// <param name="p1">the other point
		/// </param>
		/// <returns> the distance between these two points
		/// </returns>
		public float distance(Point4f 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));
		}
Exemplo n.º 11
0
		/// <summary> Computes the square of the distance between this point and point p1.</summary>
		/// <param name="p1">the other point
		/// </param>
		/// <returns> the square of distance between these two points as a float
		/// </returns>
		public float distanceSquared(Point4f p1)
		{
			double dx = x - p1.x;
			double dy = y - p1.y;
			double dz = z - p1.z;
			double dw = w - p1.w;
			//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) (dx * dx + dy * dy + dz * dz + dw * dw);
		}
Exemplo n.º 12
0
		/// <summary> Constructs and initializes a Point4f from the specified Point4f.</summary>
		/// <param name="p1">the Point4f containing the initialization x y z w data
		/// </param>
		public Point4f(Point4f p1):base(p1)
		{
		}