/// <summary> /// Multiplacation of a <see cref="M44f"/> with a <see cref="Shift3f"/>. /// </summary> public static M44f Multiply(M44f matrix, Shift3f shift) { return(new M44f( 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 )); }
/// <summary> /// Creates new Identity <see cref="M44f"/> with a <see cref="Shift3f"/> for translation. /// </summary> /// <returns>Translation matrix.</returns> public static M44f Translation(Shift3f s) { return(new M44f(1, 0, 0, s.X, 0, 1, 0, s.Y, 0, 0, 1, s.Z, 0, 0, 0, 1)); }
public static M34f Multiply(M34f m, Shift3f t) { return(new M34f( 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 )); }
public override bool Equals(object obj) { if (obj is Shift3f) { Shift3f shift = (Shift3f)obj; return(V.X == shift.X && V.Y == shift.Y && V.Z == shift.Z); } return(false); }
public static M34f Multiply(Rot2f rot, Shift3f shift) { float a = (float)System.Math.Cos(rot.Angle); float b = (float)System.Math.Sin(rot.Angle); return(new M34f(a, b, 0, a * shift.X + b * shift.Y, -b, a, 0, -b * shift.X + a * shift.Y, 0, 0, 1, shift.Z)); }
public static M34f Multiply(M22f matrix, Shift3f shift) { return(new M34f(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)); }
/// <summary> /// Multiplacation of a <see cref="Shift3f"/> with a <see cref="M34f"/>. /// </summary> public static M34f Multiply(Shift3f shift, M34f m) { return(new M34f( 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 )); }
/// <summary> /// Multiplacation of a <see cref="Scale3f"/> with a <see cref="Shift3f"/>. /// </summary> public static M34f Multiply(Scale3f scale, Shift3f shift) { return(new M34f( scale.X, 0, 0, scale.X * shift.X, 0, scale.Y, 0, scale.Y * shift.Y, 0, 0, scale.Z, scale.Z * shift.Z )); }
/// <summary> /// Multiplacation of a <see cref="Shift3f"/> with a <see cref="M44f"/>. /// </summary> public static M44f Multiply(Shift3f shift, M44f m) { return(new M44f( 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 )); }
public static M34f Multiply(Shift3f shift, Scale3f scale) { return(new M34f(scale.X, 0, 0, shift.X, 0, scale.Y, 0, shift.Y, 0, 0, scale.Z, shift.Z)); }
/// <summary> /// Division of a <see cref="Shift3f"/> instance with a float scalar. /// </summary> public static Shift3f Divide(Shift3f shift, float val) { return(Multiply(shift, 1 / val)); }
public static M34f Translation(Shift3f shift) { return(new M34f(1, 0, 0, shift.X, 0, 1, 0, shift.Y, 0, 0, 1, shift.Z)); }
/// <summary> /// Calculates the division of a float scalar with a <see cref="Shift3f"/>. /// </summary> public static Shift3f operator /(float val, Shift3f shift) { return(Shift3f.Divide(val, shift)); }
/// <summary> /// Division of a float scalar with a <see cref="Shift3f"/>. /// </summary> public static Shift3f Divide(float value, Shift3f shift) { return(Multiply(Reciprocal(shift), value)); }
/// <summary> /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="M34f"/>. /// </summary> public static M34f operator *(Shift3f shift, M34f mat) { return(Shift3f.Multiply(shift, mat)); }
/// <summary> /// Calculates the reciprocal of a <see cref="Shift3f"/>. /// </summary> public static Shift3f Reciprocal(Shift3f shift) { return(new Shift3f(1 / shift.X, 1 / shift.Y, 1 / shift.Z)); }
/// <summary> /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="Shift3f"/>. /// </summary> public static Shift3f operator *(Shift3f shift0, Shift3f shift1) { return(Shift3f.Multiply(shift0, shift1)); }
/// <summary> /// Calculates the multiplacation of a <see cref="Shift3f"/> with a <see cref="Scale3f"/>. /// </summary> public static M34f operator *(Shift3f shift, Scale3f scale) { return(Shift3f.Multiply(shift, scale)); }
//different calculations for shift vectors /// <summary> /// Multiplacation of a float scalar with a <see cref="Shift3f"/>. /// </summary> public static Shift3f Multiply(Shift3f shift, float value) { return(new Shift3f(shift.X * value, shift.Y * value, shift.Z * value)); }
/// <summary> /// </summary> public static M34f operator *(Shift3f shift, Rot3f rot) { return(Shift3f.Multiply(shift, (M34f)rot)); }
/// <summary> /// Negates the values of a <see cref="Shift3f"/> instance. /// </summary> public static Shift3f operator -(Shift3f shift) { return(Shift3f.Negate(shift)); }
/// <summary> /// Multiplication of two <see cref="Shift3f"/>s. /// </summary> public static Shift3f Multiply(Shift3f shift0, Shift3f shift1) { return(new Shift3f(shift0.X + shift1.X, shift0.Y + shift1.Y, shift0.Z + shift1.Z)); }
/// <summary> /// Calculates the division of a <see cref="Shift3f"/> with a float scalar. /// </summary> public static Shift3f operator /(Shift3f shift, float val) { return(Shift3f.Divide(shift, val)); }
/// <summary> /// Calculates the multiplacation of a <see cref="Shift3f"/> with a float scalar. /// </summary> public static Shift3f operator *(float value, Shift3f shift) { return(Shift3f.Multiply(shift, value)); }
/// <summary> /// Negates all values of a <see cref="Shift3f"/>. /// </summary> public static Shift3f Negate(Shift3f shift) { return(new Shift3f(-shift.X, -shift.Y, -shift.Z)); }