Example #1
0
 public Vec2 Transform(Mat2x3 matrix)
 {
     return(new Vec2
            (
                (matrix.x.x * x) + (matrix.x.y * y) + (matrix.x.z * z),
                (matrix.y.x * x) + (matrix.y.y * y) + (matrix.y.z * z)
            ));
 }
Example #2
0
        public static void Multiply(ref Mat2x3 matrix1, ref Mat3x2 matrix2, out Mat2 result)
        {
            result.x.x = (matrix1.x.x * matrix2.x.x) + (matrix1.x.y * matrix2.y.x) + (matrix1.x.z * matrix2.z.x);
            result.x.y = (matrix1.x.x * matrix2.x.y) + (matrix1.x.y * matrix2.y.y) + (matrix1.x.z * matrix2.z.y);

            result.y.x = (matrix1.y.x * matrix2.x.x) + (matrix1.y.y * matrix2.y.x) + (matrix1.y.z * matrix2.z.x);
            result.y.y = (matrix1.y.x * matrix2.x.y) + (matrix1.y.y * matrix2.y.y) + (matrix1.y.z * matrix2.z.y);
        }
Example #3
0
 public Vec3 Transform(Mat2x3 matrix)
 {
     return(new Vec3
            (
                (x * matrix.x.x) + (y * matrix.y.x),
                (x * matrix.x.y) + (y * matrix.y.y),
                (x * matrix.x.z) + (y * matrix.y.z)
            ));
 }
Example #4
0
        public static void Transpose(Mat2x3 matrix, out Mat3x2 result)
        {
            result.x.x = matrix.x.x;
            result.x.y = matrix.y.x;

            result.y.x = matrix.x.y;
            result.y.y = matrix.y.y;

            result.z.x = matrix.x.z;
            result.z.y = matrix.y.z;
        }