Ejemplo n.º 1
0
        /// <summary>
        /// Left multiply a point by this matrix and return a new point as the result
        /// </summary>
        /// <param name="point4d"></param>
        /// <returns></returns>
        public Point4d LeftMultiply(Point4d point4d)
        {
            Point4d result = new Point4d();

            LeftMultiply(point4d, result);
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Left multiply a point by this matrix and store the result into result
 /// </summary>
 /// <param name="point4d"></param>
 /// <param name="result"></param>
 public void LeftMultiply(Point4d point4d, Point4d result)
 {
     result.X = data[0] * point4d.X + data[4] * point4d.Y + data[8] * point4d.Z + data[12] * point4d.T;
     result.Y = data[1] * point4d.X + data[5] * point4d.Y + data[9] * point4d.Z + data[13] * point4d.T;
     result.Z = data[2] * point4d.X + data[6] * point4d.Y + data[10] * point4d.Z + data[14] * point4d.T;
     result.T = data[3] * point4d.X + data[7] * point4d.Y + data[11] * point4d.Z + data[15] * point4d.T;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Subtracts a point from this point
 /// </summary>
 /// <param name="point3d"></param>
 public void Subtract(Point4d point4d)
 {
     X -= point4d.X;
     Y -= point4d.Y;
     Z -= point4d.Z;
     T -= point4d.T;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds a point to this point
 /// </summary>
 /// <param name="point3d"></param>
 public void Add(Point4d point4d)
 {
     X += point4d.X;
     Y += point4d.Y;
     Z += point4d.Z;
     T += point4d.T;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Copies this vector into another vector
 /// </summary>
 /// <param name="point3f"></param>
 public void CopyTo(Point4d point4d)
 {
     point4d.X = X;
     point4d.Y = Y;
     point4d.Z = Z;
     point4d.T = T;
 }
Ejemplo n.º 6
0
        public static Point4d operator -(Point4d p1, Point4d p2)
        {
            Point4d result = new Point4d();

            p1.CopyTo(result);
            result.Add(p2);
            return(result);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Returns the dot product of this point with another point
 /// </summary>
 /// <param name="point3d"></param>
 /// <returns></returns>
 public double Dot(Point4d point4d)
 {
     return(X * point4d.X + Y * point4d.Y + Z * point4d.Z + T * point4d.T);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Subtracts a point from this point and stores in result
 /// </summary>
 /// <param name="point3d"></param>
 /// <param name="result"></param>
 public void Subtract(Point4d point4d, Point4d result)
 {
     this.CopyTo(result);
     result.Subtract(point4d);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds a point to this point and stores in result
 /// </summary>
 /// <param name="point3d"></param>
 /// <param name="result"></param>
 public void Add(Point4d point4d, Point4d result)
 {
     this.CopyTo(result);
     result.Add(point4d);
 }