Пример #1
0
        public static void InvertWithoutOverlap(ref Triangular2x2Wide m, out Triangular2x2Wide inverse)
        {
            var denom = Vector <float> .One / (m.M21 * m.M21 - m.M11 * m.M22);

            inverse.M11 = -m.M22 * denom;
            inverse.M21 = m.M21 * denom;
            inverse.M22 = -m.M11 * denom;
        }
Пример #2
0
        public static void MatrixSandwich(ref Matrix2x3Wide m, ref Triangular3x3Wide t, out Triangular2x2Wide result)
        {
            var i11 = m.X.X * t.M11 + m.X.Y * t.M21 + m.X.Z * t.M31;
            var i12 = m.X.X * t.M21 + m.X.Y * t.M22 + m.X.Z * t.M32;
            var i13 = m.X.X * t.M31 + m.X.Y * t.M32 + m.X.Z * t.M33;
            var i21 = m.Y.X * t.M11 + m.Y.Y * t.M21 + m.Y.Z * t.M31;
            var i22 = m.Y.X * t.M21 + m.Y.Y * t.M22 + m.Y.Z * t.M32;
            var i23 = m.Y.X * t.M31 + m.Y.Y * t.M32 + m.Y.Z * t.M33;

            result.M11 = i11 * m.X.X + i12 * m.X.Y + i13 * m.X.Z;
            result.M21 = i21 * m.X.X + i22 * m.X.Y + i23 * m.X.Z;
            result.M22 = i21 * m.Y.X + i22 * m.Y.Y + i23 * m.Y.Z;
        }
Пример #3
0
 public static void TransformBySymmetricWithoutOverlap(ref Vector2Wide v, ref Triangular2x2Wide m, out Vector2Wide result)
 {
     result.X = v.X * m.M11 + v.Y * m.M21;
     result.Y = v.X * m.M21 + v.Y * m.M22;
 }
Пример #4
0
 public static void Subtract(ref Triangular2x2Wide a, ref Triangular2x2Wide b, out Triangular2x2Wide result)
 {
     result.M11 = a.M11 - b.M11;
     result.M21 = a.M21 - b.M21;
     result.M22 = a.M22 - b.M22;
 }
Пример #5
0
 public static void Add(ref Triangular2x2Wide a, ref Triangular2x2Wide b, out Triangular2x2Wide result)
 {
     result.M11 = a.M11 + b.M11;
     result.M21 = a.M21 + b.M21;
     result.M22 = a.M22 + b.M22;
 }
Пример #6
0
 public static void SandwichScale(ref Matrix2x3Wide m, ref Vector <float> scale, out Triangular2x2Wide result)
 {
     result.M11 = scale * (m.X.X * m.X.X + m.X.Y * m.X.Y + m.X.Z * m.X.Z);
     result.M21 = scale * (m.Y.X * m.X.X + m.Y.Y * m.X.Y + m.Y.Z * m.X.Z);
     result.M22 = scale * (m.Y.X * m.Y.X + m.Y.Y * m.Y.Y + m.Y.Z * m.Y.Z);
 }