Example #1
0
 /// <summary> Gets the value of this tuple and copies the values into the Tuple4d.</summary>
 /// <param name="t">Tuple4d object into which that values of this object are copied
 /// </param>
 public void  get_Renamed(Tuple4d t)
 {
     t.x = x;
     t.y = y;
     t.z = z;
     t.w = w;
 }
Example #2
0
 /// <summary> Sets the value of this tuple to the vector sum of tuples t1 and t2.</summary>
 /// <param name="t1">the first tuple
 /// </param>
 /// <param name="t2">the second tuple
 /// </param>
 public void  add(Tuple4d t1, Tuple4d t2)
 {
     x = t1.x + t2.x;
     y = t1.y + t2.y;
     z = t1.z + t2.z;
     w = t1.w + t2.w;
 }
Example #3
0
 /// <summary> Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).</summary>
 /// <param name="t1">the first tuple
 /// </param>
 /// <param name="t2">the second tuple
 /// </param>
 public void  sub(Tuple4d t1, Tuple4d t2)
 {
     x = t1.x - t2.x;
     y = t1.y - t2.y;
     z = t1.z - t2.z;
     w = t1.w - t2.w;
 }
Example #4
0
 /// <summary> Sets the value of this tuple to the value of tuple t1.</summary>
 /// <param name="t1">the tuple to be copied
 /// </param>
 public void  set_Renamed(Tuple4d t1)
 {
     x = t1.x;
     y = t1.y;
     z = t1.z;
     w = t1.w;
 }
Example #5
0
 /// <summary> Sets the value of this tuple to the negation of tuple t1. </summary>
 /// <param name="t1">the source vector
 /// </param>
 public void  negate(Tuple4d t1)
 {
     x = -t1.x;
     y = -t1.y;
     z = -t1.z;
     w = -t1.w;
 }
Example #6
0
 /// <summary> Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).</summary>
 /// <param name="t1">the other tuple
 /// </param>
 public void  sub(Tuple4d t1)
 {
     x -= t1.x;
     y -= t1.y;
     z -= t1.z;
     w -= t1.w;
 }
Example #7
0
 /// <summary> Sets the value of this tuple to the scalar multiplication of tuple t1 and then
 /// adds tuple t2 (this = s*t1 + t2).
 /// </summary>
 /// <param name="s">the scalar value
 /// </param>
 /// <param name="t1">the tuple to be multipled
 /// </param>
 /// <param name="t2">the tuple to be added
 /// </param>
 public void  scaleAdd(double s, Tuple4d t1, Tuple4d t2)
 {
     x = s * t1.x + t2.x;
     y = s * t1.y + t2.y;
     z = s * t1.z + t2.z;
     w = s * t1.w + t2.w;
 }
Example #8
0
 /// <summary> Sets the value of this tuple to the scalar multiplication of tuple t1.</summary>
 /// <param name="s">the scalar value
 /// </param>
 /// <param name="t1">the source tuple
 /// </param>
 public void  scale(double s, Tuple4d t1)
 {
     x = s * t1.x;
     y = s * t1.y;
     z = s * t1.z;
     w = s * t1.w;
 }
Example #9
0
 /// <summary> Sets the value of this tuple to the vector sum of itself and tuple t1.</summary>
 /// <param name="t1"> the other tuple
 /// </param>
 public void  add(Tuple4d t1)
 {
     x += t1.x;
     y += t1.y;
     z += t1.z;
     w += t1.w;
 }
Example #10
0
 /// <summary> Sets the value of this tuple to the scalar multiplication of itself and then
 /// adds tuple t1 (this = s*this + t1).
 /// </summary>
 /// <param name="s">the scalar value
 /// </param>
 /// <param name="t1">the tuple to be added
 /// </param>
 public void  scaleAdd(double s, Tuple4d t1)
 {
     x = s * x + t1.x;
     y = s * y + t1.y;
     z = s * z + t1.z;
     w = s * z + t1.w;
 }
Example #11
0
        /// <summary> Linearly interpolates between this tuple and tuple t1 and places the
        /// result into this tuple: this = (1-alpha)*this + alpha*t1.
        /// </summary>
        /// <param name="t1">the first tuple
        /// </param>
        /// <param name="alpha">the alpha interpolation parameter
        ///
        /// </param>
        public void  interpolate(Tuple4d t1, double alpha)
        {
            double beta = 1 - alpha;

            x = beta * x + alpha * t1.x;
            y = beta * y + alpha * t1.y;
            z = beta * z + alpha * t1.z;
            w = beta * w + alpha * t1.w;
        }
Example #12
0
        /// <summary> Constructs and initializes a Quat4d from the specified Tuple4d.  </summary>
        /// <param name="t1">the Tuple4d containing the initialization x y z w data
        /// </param>
        public Quat4d(Tuple4d t1)
        {
            double mag;

            mag = 1.0 / System.Math.Sqrt(t1.x * t1.x + t1.y * t1.y + t1.z * t1.z + t1.w * t1.w);
            x   = t1.x * mag;
            y   = t1.y * mag;
            z   = t1.z * mag;
            w   = t1.w * mag;
        }
Example #13
0
 /// <summary> Sets the value of this tuple to the value of tuple t1.</summary>
 /// <param name="t1">the tuple to be copied
 /// </param>
 public void  set_Renamed(Tuple4d t1)
 {
     //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'"
     x = (float)t1.x;
     //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'"
     y = (float)t1.y;
     //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'"
     z = (float)t1.z;
     //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'"
     w = (float)t1.w;
 }
Example #14
0
        /// <summary> Constructs and initializes a Quat4f from the specified Tuple4d.  </summary>
        /// <param name="t1">the Tuple4d containing the initialization x y z w data
        /// </param>
        public Quat4f(Tuple4d t1)
        {
            double mag;

            mag = 1.0 / System.Math.Sqrt(t1.x * t1.x + t1.y * t1.y + t1.z * t1.z + t1.w * t1.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'"
            x = (float)(t1.x * mag);
            //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'"
            y = (float)(t1.y * mag);
            //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'"
            z = (float)(t1.z * mag);
            //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'"
            w = (float)(t1.w * mag);
        }
Example #15
0
		/// <summary> Returns a hash number based on the data values in this
		/// object.  Two different Matrix4d objects with identical data values
		/// (ie, returns true for equals(Matrix4d) ) will return the same hash
		/// number.  Two objects with different data members may return the
		/// same hash value, although this is not likely.
		/// </summary>
		/// <returns> the integer hash value 
		/// </returns>
        //public override int GetHashCode()
        //{
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long bits = Double.doubleToLongBits(m00);
        //    int hash = (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m01);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m02);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m03);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m10);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m11);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m12);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m13);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m20);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m21);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m22);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m23);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m30);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m31);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m32);
        //    hash ^= (int) (bits ^ (bits >> 32));
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    bits = Double.doubleToLongBits(m33);
        //    hash ^= (int) (bits ^ (bits >> 32));
			
        //    return hash;
        //}
		
		/// <summary> Transform the vector vec using this Matrix4d and place the
		/// result into vecOut.
		/// </summary>
		/// <param name="vec">the double precision vector to be transformed
		/// </param>
		/// <param name="vecOut">the vector into which the transformed values are placed
		/// </param>
		public void  transform(Tuple4d vec, Tuple4d vecOut)
		{
			// alias-safe
			vecOut.set_Renamed(m00 * vec.x + m01 * vec.y + m02 * vec.z + m03 * vec.w, m10 * vec.x + m11 * vec.y + m12 * vec.z + m13 * vec.w, m20 * vec.x + m21 * vec.y + m22 * vec.z + m23 * vec.w, m30 * vec.x + m31 * vec.y + m32 * vec.z + m33 * vec.w);
		}
Example #16
0
 /// <summary> Constructs and initializes a Point4f from the specified Tuple4d.</summary>
 /// <param name="t1">the Tuple4d containing the initialization x y z w data
 /// </param>
 public Point4f(Tuple4d t1) : base(t1)
 {
 }
Example #17
0
		/// <summary> Sets the value of this tuple to the scalar multiplication of tuple t1.</summary>
		/// <param name="s">the scalar value
		/// </param>
		/// <param name="t1">the source tuple
		/// </param>
		public void  scale(double s, Tuple4d t1)
		{
			x = s * t1.x;
			y = s * t1.y;
			z = s * t1.z;
			w = s * t1.w;
		}
Example #18
0
 /// <summary> Constructs and initializes a Vector4f from the specified Tuple4d.</summary>
 /// <param name="t1">the Tuple4d containing the initialization x y z w data
 /// </param>
 public Vector4f(Tuple4d t1) : base(t1)
 {
 }
Example #19
0
		/// <summary> Sets the value of this tuple to the vector sum of itself and tuple t1.</summary>
		/// <param name="t1"> the other tuple
		/// </param>
		public void  add(Tuple4d t1)
		{
			x += t1.x;
			y += t1.y;
			z += t1.z;
			w += t1.w;
		}
Example #20
0
		/// <summary> Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).</summary>
		/// <param name="t1">the other tuple
		/// </param>
		public void  sub(Tuple4d t1)
		{
			x -= t1.x;
			y -= t1.y;
			z -= t1.z;
			w -= t1.w;
		}
Example #21
0
		/// <summary> Clamps the minimum value of the tuple parameter to the min parameter
		/// and places the values into this tuple.
		/// </summary>
		/// <param name="min">the lowest value in the tuple after clamping
		/// </param>
		/// <parm>  t the source tuple, which will not be modified </parm>
		public void  clampMin(double min, Tuple4d t)
		{
			set_Renamed(t);
			clampMin(min);
		}
Example #22
0
		/// <summary> Gets the value of this tuple and copies the values into the Tuple4d.</summary>
		/// <param name="t">Tuple4d object into which that values of this object are copied
		/// </param>
		public void  get_Renamed(Tuple4d t)
		{
			t.x = x;
			t.y = y;
			t.z = z;
			t.w = w;
		}
Example #23
0
		/// <summary> Sets the value of this tuple to the scalar multiplication of itself and then
		/// adds tuple t1 (this = s*this + t1).
		/// </summary>
		/// <param name="s">the scalar value
		/// </param>
		/// <param name="t1">the tuple to be added
		/// </param>
		public void  scaleAdd(double s, Tuple4d t1)
		{
			x = s * x + t1.x;
			y = s * y + t1.y;
			z = s * z + t1.z;
			w = s * z + t1.w;
		}
Example #24
0
		/// <summary> Returns true if the L-infinite distance between this tuple and tuple t1 is
		/// less than or equal to the epsilon parameter, otherwise returns false. The L-infinite
		/// distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2), abs(w1-w2)].
		/// </summary>
		/// <param name="t1">the tuple to be compared to this tuple
		/// </param>
		/// <param name="epsilon">the threshold value
		/// </param>
		public virtual bool epsilonEquals(Tuple4d t1, double epsilon)
		{
			return (System.Math.Abs(t1.x - this.x) <= epsilon) && (System.Math.Abs(t1.y - this.y) <= epsilon) && (System.Math.Abs(t1.z - this.z) <= epsilon) && (System.Math.Abs(t1.w - this.w) <= epsilon);
		}
Example #25
0
		/// <summary> Transform the vector vec using this Matrix4d and place the
		/// result back into vec.
		/// </summary>
		/// <param name="vec">the double precision vector to be transformed
		/// </param>
		public void  transform(Tuple4d vec)
		{
			transform(vec, vec);
		}
Example #26
0
		/// <summary> Constructs and initializes a Point4f from the specified Tuple4d.</summary>
		/// <param name="t1">the Tuple4d containing the initialization x y z w data
		/// </param>
		public Point4f(Tuple4d t1):base(t1)
		{
		}
Example #27
0
		/// <summary> Constructs and initializes a Quat4d from the specified Tuple4d.  </summary>
		/// <param name="t1">the Tuple4d containing the initialization x y z w data 
		/// </param>
		public Quat4d(Tuple4d t1)
		{
			double mag;
			mag = 1.0 / System.Math.Sqrt(t1.x * t1.x + t1.y * t1.y + t1.z * t1.z + t1.w * t1.w);
			x = t1.x * mag;
			y = t1.y * mag;
			z = t1.z * mag;
			w = t1.w * mag;
		}
Example #28
0
		/// <summary> Constructs and initializes a Tuple4d from the specified Tuple4d.</summary>
		/// <param name="t1">the Tuple4d containing the initialization x y z w data
		/// </param>
		public Tuple4d(Tuple4d t1)
		{
			set_Renamed(t1);
		}
Example #29
0
		/// <summary> Sets each component of the tuple parameter to its absolute value and
		/// places the modified values into this tuple.
		/// </summary>
		/// <param name="t">the source tuple, which will not be modified
		/// </param>
		public void  absolute(Tuple4d t)
		{
			set_Renamed(t);
			absolute();
		}
Example #30
0
		/// <summary> Sets the value of this tuple to the value of tuple t1.</summary>
		/// <param name="t1">the tuple to be copied
		/// </param>
		public void  set_Renamed(Tuple4d t1)
		{
			x = t1.x;
			y = t1.y;
			z = t1.z;
			w = t1.w;
		}
Example #31
0
		/// <summary> Linearly interpolates between this tuple and tuple t1 and places the
		/// result into this tuple: this = (1-alpha)*this + alpha*t1.
		/// </summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="alpha">the alpha interpolation parameter
		/// 
		/// </param>
		public void  interpolate(Tuple4d t1, double alpha)
		{
			double beta = 1 - alpha;
			x = beta * x + alpha * t1.x;
			y = beta * y + alpha * t1.y;
			z = beta * z + alpha * t1.z;
			w = beta * w + alpha * t1.w;
		}
Example #32
0
		/// <summary> Sets the value of this tuple to the vector sum of tuples t1 and t2.</summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="t2">the second tuple
		/// </param>
		public void  add(Tuple4d t1, Tuple4d t2)
		{
			x = t1.x + t2.x;
			y = t1.y + t2.y;
			z = t1.z + t2.z;
			w = t1.w + t2.w;
		}
Example #33
0
		/// <summary> Constructs and initializes a Quat4f from the specified Tuple4d.  </summary>
		/// <param name="t1">the Tuple4d containing the initialization x y z w data 
		/// </param>
		public Quat4f(Tuple4d t1)
		{
			double mag;
			mag = 1.0 / System.Math.Sqrt(t1.x * t1.x + t1.y * t1.y + t1.z * t1.z + t1.w * t1.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'"
			x = (float) (t1.x * mag);
			//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'"
			y = (float) (t1.y * mag);
			//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'"
			z = (float) (t1.z * mag);
			//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'"
			w = (float) (t1.w * mag);
		}
Example #34
0
		/// <summary> Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).</summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="t2">the second tuple
		/// </param>
		public void  sub(Tuple4d t1, Tuple4d t2)
		{
			x = t1.x - t2.x;
			y = t1.y - t2.y;
			z = t1.z - t2.z;
			w = t1.w - t2.w;
		}
Example #35
0
 /// <summary> Sets each component of the tuple parameter to its absolute value and
 /// places the modified values into this tuple.
 /// </summary>
 /// <param name="t">the source tuple, which will not be modified
 /// </param>
 public void  absolute(Tuple4d t)
 {
     set_Renamed(t);
     absolute();
 }
Example #36
0
		/// <summary> Sets the value of this tuple to the negation of tuple t1. </summary>
		/// <param name="t1">the source vector
		/// </param>
		public void  negate(Tuple4d t1)
		{
			x = - t1.x;
			y = - t1.y;
			z = - t1.z;
			w = - t1.w;
		}
Example #37
0
 /// <summary> Linearly interpolates between tuples t1 and t2 and places the
 /// result into this tuple: this = (1-alpha)*t1 + alpha*t2.
 /// </summary>
 /// <param name="t1">the first tuple
 /// </param>
 /// <param name="t2">the second tuple
 /// </param>
 /// <param name="alpha">the alpha interpolation parameter
 /// </param>
 public void  interpolate(Tuple4d t1, Tuple4d t2, double alpha)
 {
     set_Renamed(t1);
     interpolate(t2, alpha);
 }
Example #38
0
		/// <summary> Sets the value of this tuple to the scalar multiplication of tuple t1 and then
		/// adds tuple t2 (this = s*t1 + t2).
		/// </summary>
		/// <param name="s">the scalar value
		/// </param>
		/// <param name="t1">the tuple to be multipled
		/// </param>
		/// <param name="t2">the tuple to be added
		/// </param>
		public void  scaleAdd(double s, Tuple4d t1, Tuple4d t2)
		{
			x = s * t1.x + t2.x;
			y = s * t1.y + t2.y;
			z = s * t1.z + t2.z;
			w = s * t1.w + t2.w;
		}
Example #39
0
 /// <summary> Constructs and initializes a Tuple4d from the specified Tuple4d.</summary>
 /// <param name="t1">the Tuple4d containing the initialization x y z w data
 /// </param>
 public Tuple4d(Tuple4d t1)
 {
     set_Renamed(t1);
 }
Example #40
0
		/// <summary> Returns a hash number based on the data values in this object. 
		/// Two different Tuple4d objects with identical data  values
		/// (ie, returns true for equals(Tuple4d) ) will return the same hash number.
		/// Two vectors with different data members may return the same hash value,
		/// although this is not likely.
		/// </summary>
        //public override int GetHashCode()
        //{
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long xbits = Double.doubleToLongBits(x);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long ybits = Double.doubleToLongBits(y);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long zbits = Double.doubleToLongBits(z);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long wbits = Double.doubleToLongBits(w);
        //    return (int) (xbits ^ (xbits >> 32) ^ ybits ^ (ybits >> 32) ^ zbits ^ (zbits >> 32) ^ wbits ^ (wbits >> 32));
        //}
		
		/// <summary> Returns true if all of the data members of Tuple4d t1 are equal to the corresponding
		/// data members in this
		/// </summary>
		/// <param name="t1">the vector with which the comparison is made.
		/// </param>
		public bool equals(Tuple4d t1)
		{
			return t1 != null && x == t1.x && y == t1.y && z == t1.z && w == t1.w;
		}
Example #41
0
        /// <summary> Returns a hash number based on the data values in this object.
        /// Two different Tuple4d objects with identical data  values
        /// (ie, returns true for equals(Tuple4d) ) will return the same hash number.
        /// Two vectors with different data members may return the same hash value,
        /// although this is not likely.
        /// </summary>
        //public override int GetHashCode()
        //{
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long xbits = Double.doubleToLongBits(x);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long ybits = Double.doubleToLongBits(y);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long zbits = Double.doubleToLongBits(z);
        //    //UPGRADE_ISSUE: Method 'java.lang.Double.doubleToLongBits' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javalangDoubledoubleToLongBits_double'"
        //    long wbits = Double.doubleToLongBits(w);
        //    return (int) (xbits ^ (xbits >> 32) ^ ybits ^ (ybits >> 32) ^ zbits ^ (zbits >> 32) ^ wbits ^ (wbits >> 32));
        //}

        /// <summary> Returns true if all of the data members of Tuple4d t1 are equal to the corresponding
        /// data members in this
        /// </summary>
        /// <param name="t1">the vector with which the comparison is made.
        /// </param>
        public bool equals(Tuple4d t1)
        {
            return(t1 != null && x == t1.x && y == t1.y && z == t1.z && w == t1.w);
        }
Example #42
0
		/// <summary> Clamps the tuple parameter to the range [low, high] and places the values
		/// into this tuple.
		/// </summary>
		/// <param name="min">the lowest value in the tuple after clamping
		/// </param>
		/// <param name="max">the highest value in the tuple after clamping
		/// </param>
		/// <param name="t">the source tuple, which will not be modified
		/// </param>
		public void  clamp(double min, double max, Tuple4d t)
		{
			set_Renamed(t);
			clamp(min, max);
		}
Example #43
0
 /// <summary> Returns true if the L-infinite distance between this tuple and tuple t1 is
 /// less than or equal to the epsilon parameter, otherwise returns false. The L-infinite
 /// distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2), abs(w1-w2)].
 /// </summary>
 /// <param name="t1">the tuple to be compared to this tuple
 /// </param>
 /// <param name="epsilon">the threshold value
 /// </param>
 public virtual bool epsilonEquals(Tuple4d t1, double epsilon)
 {
     return((System.Math.Abs(t1.x - this.x) <= epsilon) && (System.Math.Abs(t1.y - this.y) <= epsilon) && (System.Math.Abs(t1.z - this.z) <= epsilon) && (System.Math.Abs(t1.w - this.w) <= epsilon));
 }
Example #44
0
		/// <summary> Clamps the maximum value of the tuple parameter to the max parameter and
		/// places the values into this tuple.
		/// </summary>
		/// <param name="max">the highest value in the tuple after clamping
		/// </param>
		/// <param name="t">the source tuple, which will not be modified
		/// </param>
		public void  clampMax(double max, Tuple4d t)
		{
			set_Renamed(t);
			clampMax(max);
		}
Example #45
0
 /// <summary> Clamps the tuple parameter to the range [low, high] and places the values
 /// into this tuple.
 /// </summary>
 /// <param name="min">the lowest value in the tuple after clamping
 /// </param>
 /// <param name="max">the highest value in the tuple after clamping
 /// </param>
 /// <param name="t">the source tuple, which will not be modified
 /// </param>
 public void  clamp(double min, double max, Tuple4d t)
 {
     set_Renamed(t);
     clamp(min, max);
 }
Example #46
0
		/// <summary> Linearly interpolates between tuples t1 and t2 and places the
		/// result into this tuple: this = (1-alpha)*t1 + alpha*t2.
		/// </summary>
		/// <param name="t1">the first tuple
		/// </param>
		/// <param name="t2">the second tuple
		/// </param>
		/// <param name="alpha">the alpha interpolation parameter
		/// </param>
		public void  interpolate(Tuple4d t1, Tuple4d t2, double alpha)
		{
			set_Renamed(t1);
			interpolate(t2, alpha);
		}
Example #47
0
 /// <summary> Clamps the minimum value of the tuple parameter to the min parameter
 /// and places the values into this tuple.
 /// </summary>
 /// <param name="min">the lowest value in the tuple after clamping
 /// </param>
 /// <parm>  t the source tuple, which will not be modified </parm>
 public void  clampMin(double min, Tuple4d t)
 {
     set_Renamed(t);
     clampMin(min);
 }
Example #48
0
		/// <summary> Constructs and initializes a Vector4d from the specified Tuple4d.</summary>
		/// <param name="t1">the Tuple4d containing the initialization x y z w data
		/// </param>
		public Vector4d(Tuple4d t1):base(t1)
		{
		}
Example #49
0
 /// <summary> Clamps the maximum value of the tuple parameter to the max parameter and
 /// places the values into this tuple.
 /// </summary>
 /// <param name="max">the highest value in the tuple after clamping
 /// </param>
 /// <param name="t">the source tuple, which will not be modified
 /// </param>
 public void  clampMax(double max, Tuple4d t)
 {
     set_Renamed(t);
     clampMax(max);
 }