/// <summary> Multiplies each of the x,y,z components of the Point4d 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(Point4d p1) { // zero div may occur. x = p1.x / p1.w; y = p1.y / p1.w; z = p1.z / p1.w; w = 1.0; }
/// <summary> Multiplies each of the x,y,z components of the Point4d 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(Point4d p1) { double oneOw; oneOw = 1 / p1.w; x = p1.x * oneOw; y = p1.y * oneOw; z = p1.z * oneOw; }
/// <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 this point and p1 /// </returns> public double distanceSquared(Point4d 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)); }
/// <summary> Constructs and initializes a Point4f from the specified Point4d.</summary> /// <param name="p1">the Point4d containing the initialization x y z w data /// </param> public Point4f(Point4d p1) : base(p1) { }
/// <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 double distanceLinf(Point4d p1) { // return type changed from float to double as of API1.1 Beta02 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)))); }
/// <summary> Returns the distance between this point and point p1.</summary> /// <param name="p1">the other point /// </param> /// <returns> the distance between this point and point p1. /// </returns> public double distance(Point4d p1) { return(System.Math.Sqrt(distanceSquared(p1))); }
/// <summary> Constructs and initializes a Point4f from the specified Point4d.</summary> /// <param name="p1">the Point4d containing the initialization x y z w data /// </param> public Point4f(Point4d p1):base(p1) { }
/// <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 double distanceLinf(Point4d p1) { // return type changed from float to double as of API1.1 Beta02 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))); }
/// <summary> Returns the distance between this point and point p1.</summary> /// <param name="p1">the other point /// </param> /// <returns> the distance between this point and point p1. /// </returns> public double distance(Point4d p1) { return System.Math.Sqrt(distanceSquared(p1)); }
/// <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 this point and p1 /// </returns> public double distanceSquared(Point4d 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); }