Beispiel #1
0
 /// <summary>
 /// Creates new Identity <see cref="M44d"/> with a <see cref="Shift3d"/> for translation.
 /// </summary>
 /// <returns>Translation matrix.</returns>
 public static M44d Translation(Shift3d s)
 {
     return(new M44d(1, 0, 0, s.X,
                     0, 1, 0, s.Y,
                     0, 0, 1, s.Z,
                     0, 0, 0, 1));
 }
Beispiel #2
0
        /// <summary>
        /// Multiplacation of a <see cref="M44d"/> with a <see cref="Shift3d"/>.
        /// </summary>
        public static M44d Multiply(M44d matrix, Shift3d shift)
        {
            return(new M44d(
                       matrix.M00,
                       matrix.M01,
                       matrix.M02,
                       matrix.M00 * shift.X +
                       matrix.M01 * shift.Y +
                       matrix.M02 * shift.Z +
                       matrix.M03,

                       matrix.M10,
                       matrix.M11,
                       matrix.M12,
                       matrix.M10 * shift.X +
                       matrix.M11 * shift.Y +
                       matrix.M12 * shift.Z +
                       matrix.M13,

                       matrix.M20,
                       matrix.M21,
                       matrix.M22,
                       matrix.M20 * shift.X +
                       matrix.M21 * shift.Y +
                       matrix.M22 * shift.Z +
                       matrix.M23,

                       matrix.M30,
                       matrix.M31,
                       matrix.M32,
                       matrix.M33
                       ));
        }
Beispiel #3
0
 public static M34d Multiply(M34d m, Shift3d t)
 {
     return(new M34d(
                m.M00, m.M01, m.M02, m.M00 * t.X + m.M01 * t.Y + m.M02 * t.Z + m.M03,
                m.M10, m.M11, m.M12, m.M10 * t.X + m.M11 * t.Y + m.M12 * t.Z + m.M13,
                m.M20, m.M21, m.M22, m.M20 * t.X + m.M21 * t.Y + m.M22 * t.Z + m.M23
                ));
 }
Beispiel #4
0
 public override bool Equals(object obj)
 {
     if (obj is Shift3d)
     {
         Shift3d shift = (Shift3d)obj;
         return(V.X == shift.X && V.Y == shift.Y && V.Z == shift.Z);
     }
     return(false);
 }
        public static M34d Multiply(Rot2d rot, Shift3d shift)
        {
            double a = (double)System.Math.Cos(rot.Angle);
            double b = (double)System.Math.Sin(rot.Angle);

            return(new M34d(a, b, 0, a * shift.X + b * shift.Y,
                            -b, a, 0, -b * shift.X + a * shift.Y,
                            0, 0, 1, shift.Z));
        }
Beispiel #6
0
        public static M34d Multiply(M22d matrix, Shift3d shift)
        {
            return(new M34d(matrix.M00,
                            matrix.M01,
                            0,
                            matrix.M00 * shift.X +
                            matrix.M01 * shift.Y,

                            matrix.M10,
                            matrix.M11,
                            0,
                            matrix.M10 * shift.X +
                            matrix.M11 * shift.Y,

                            0,
                            0,
                            1,
                            shift.Z));
        }
Beispiel #7
0
        /// <summary>
        /// Multiplacation of a <see cref="Shift3d"/> with a <see cref="M34d"/>.
        /// </summary>
        public static M34d Multiply(Shift3d shift, M34d m)
        {
            return(new M34d(
                       m.M00,
                       m.M01,
                       m.M02,
                       m.M03 + shift.X,

                       m.M10,
                       m.M11,
                       m.M12,
                       m.M13 + shift.Y,

                       m.M20,
                       m.M21,
                       m.M22,
                       m.M23 + shift.Z
                       ));
        }
Beispiel #8
0
        /// <summary>
        /// Multiplacation of a <see cref="Scale3d"/> with a <see cref="Shift3d"/>.
        /// </summary>
        public static M34d Multiply(Scale3d scale, Shift3d shift)
        {
            return(new M34d(
                       scale.X,
                       0,
                       0,
                       scale.X * shift.X,

                       0,
                       scale.Y,
                       0,
                       scale.Y * shift.Y,

                       0,
                       0,
                       scale.Z,
                       scale.Z * shift.Z

                       ));
        }
Beispiel #9
0
        /// <summary>
        /// Multiplacation of a <see cref="Shift3d"/> with a <see cref="M44d"/>.
        /// </summary>
        public static M44d Multiply(Shift3d shift, M44d m)
        {
            return(new M44d(
                       m.M00 + shift.X * m.M30,
                       m.M01 + shift.X * m.M31,
                       m.M02 + shift.X * m.M32,
                       m.M03 + shift.X * m.M33,

                       m.M10 + shift.Y * m.M30,
                       m.M11 + shift.Y * m.M31,
                       m.M12 + shift.Y * m.M32,
                       m.M13 + shift.Y * m.M33,

                       m.M20 + shift.Z * m.M30,
                       m.M21 + shift.Z * m.M31,
                       m.M22 + shift.Z * m.M32,
                       m.M23 + shift.Z * m.M33,

                       m.M30,
                       m.M31,
                       m.M32,
                       m.M33
                       ));
        }
Beispiel #10
0
 public static M34d Multiply(Shift3d shift, Scale3d scale)
 {
     return(new M34d(scale.X, 0, 0, shift.X,
                     0, scale.Y, 0, shift.Y,
                     0, 0, scale.Z, shift.Z));
 }
Beispiel #11
0
 public static M34d Translation(Shift3d shift)
 {
     return(new M34d(1, 0, 0, shift.X,
                     0, 1, 0, shift.Y,
                     0, 0, 1, shift.Z));
 }
Beispiel #12
0
 /// <summary>
 /// Division of a <see cref="Shift3d"/> instance with a double scalar.
 /// </summary>
 public static Shift3d Divide(Shift3d shift, double val)
 {
     return(Multiply(shift, 1 / val));
 }
Beispiel #13
0
 /// <summary>
 /// Calculates the division of a double scalar with a <see cref="Shift3d"/>.
 /// </summary>
 public static Shift3d operator /(double val, Shift3d shift)
 {
     return(Shift3d.Divide(val, shift));
 }
Beispiel #14
0
 /// <summary>
 /// Division of a double scalar with a <see cref="Shift3d"/>.
 /// </summary>
 public static Shift3d Divide(double value, Shift3d shift)
 {
     return(Multiply(Reciprocal(shift), value));
 }
Beispiel #15
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3d"/> with a <see cref="M34d"/>.
 /// </summary>
 public static M34d operator *(Shift3d shift, M34d mat)
 {
     return(Shift3d.Multiply(shift, mat));
 }
Beispiel #16
0
 /// <summary>
 /// Calculates the reciprocal of a <see cref="Shift3d"/>.
 /// </summary>
 public static Shift3d Reciprocal(Shift3d shift)
 {
     return(new Shift3d(1 / shift.X, 1 / shift.Y, 1 / shift.Z));
 }
Beispiel #17
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3d"/> with a <see cref="Shift3d"/>.
 /// </summary>
 public static Shift3d operator *(Shift3d shift0, Shift3d shift1)
 {
     return(Shift3d.Multiply(shift0, shift1));
 }
Beispiel #18
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3d"/> with a <see cref="Scale3d"/>.
 /// </summary>
 public static M34d operator *(Shift3d shift, Scale3d scale)
 {
     return(Shift3d.Multiply(shift, scale));
 }
Beispiel #19
0
        //different calculations for shift vectors

        /// <summary>
        /// Multiplacation of a float scalar with a <see cref="Shift3d"/>.
        /// </summary>
        public static Shift3d Multiply(Shift3d shift, double value)
        {
            return(new Shift3d(shift.X * value,
                               shift.Y * value,
                               shift.Z * value));
        }
Beispiel #20
0
 /// <summary>
 /// </summary>
 public static M34d operator *(Shift3d shift, Rot3d rot)
 {
     return(Shift3d.Multiply(shift, (M34d)rot));
 }
Beispiel #21
0
 /// <summary>
 /// Negates the values of a <see cref="Shift3d"/> instance.
 /// </summary>
 public static Shift3d operator -(Shift3d shift)
 {
     return(Shift3d.Negate(shift));
 }
Beispiel #22
0
 /// <summary>
 /// Multiplication of two <see cref="Shift3d"/>s.
 /// </summary>
 public static Shift3d Multiply(Shift3d shift0, Shift3d shift1)
 {
     return(new Shift3d(shift0.X + shift1.X,
                        shift0.Y + shift1.Y,
                        shift0.Z + shift1.Z));
 }
Beispiel #23
0
 /// <summary>
 /// Calculates the division of a <see cref="Shift3d"/> with a double scalar.
 /// </summary>
 public static Shift3d operator /(Shift3d shift, double val)
 {
     return(Shift3d.Divide(shift, val));
 }
Beispiel #24
0
 /// <summary>
 /// Calculates the multiplacation of a <see cref="Shift3d"/> with a double scalar.
 /// </summary>
 public static Shift3d operator *(double value, Shift3d shift)
 {
     return(Shift3d.Multiply(shift, value));
 }
Beispiel #25
0
 /// <summary>
 /// Negates all values of a <see cref="Shift3d"/>.
 /// </summary>
 public static Shift3d Negate(Shift3d shift)
 {
     return(new Shift3d(-shift.X, -shift.Y, -shift.Z));
 }