Ejemplo n.º 1
0
 public static double3x3 transpose(double3x3 v)
 {
     return(double3x3(
                v.c0.x, v.c0.y, v.c0.z,
                v.c1.x, v.c1.y, v.c1.z,
                v.c2.x, v.c2.y, v.c2.z));
 }
Ejemplo n.º 2
0
        public static double determinant(double3x3 m)
        {
            double3 c0 = m.c0;
            double3 c1 = m.c1;
            double3 c2 = m.c2;

            double m00 = c1.y * c2.z - c1.z * c2.y;
            double m01 = c0.y * c2.z - c0.z * c2.y;
            double m02 = c0.y * c1.z - c0.z * c1.y;

            return(c0.x * m00 - c1.x * m01 + c2.x * m02);
        }
Ejemplo n.º 3
0
        /// <summary>Returns the double3x3 full inverse of a double3x3 matrix.\n\t\t/// </summary>
        public static double3x3 inverse(double3x3 m)
        {
            double3 c0 = m.c0;
            double3 c1 = m.c1;
            double3 c2 = m.c2;

            double3 t0 = double3(c1.x, c2.x, c0.x);
            double3 t1 = double3(c1.y, c2.y, c0.y);
            double3 t2 = double3(c1.z, c2.z, c0.z);

            double3 m0 = t1 * t2.yzx - t1.yzx * t2;
            double3 m1 = t0.yzx * t2 - t0 * t2.yzx;
            double3 m2 = t0 * t1.yzx - t0.yzx * t1;

            double rcpDet = 1.0 / csum(t0.zxy * m0);

            return(double3x3(m0, m1, m2) * rcpDet);
        }
Ejemplo n.º 4
0
 public static uint3x3 uint3x3(double3x3 v)
 {
     return(new uint3x3(v));
 }
Ejemplo n.º 5
0
 public uint3x3(double3x3 v)
 {
     this.c0 = (uint3)v.c0;
     this.c1 = (uint3)v.c1;
     this.c2 = (uint3)v.c2;
 }
Ejemplo n.º 6
0
 public static uint3 hashwide(double3x3 v)
 {
     return((fold_to_uint(v.c0) * uint3(0x91475DF7u, 0x55E84827u, 0x90A285BBu) +
             fold_to_uint(v.c1) * uint3(0x5D19E1D5u, 0xFAAF07DDu, 0x625C45BDu) +
             fold_to_uint(v.c2) * uint3(0xC9F27FCBu, 0x6D2523B1u, 0x6E2BF6A9u)) + 0xCC74B3B7u);
 }
Ejemplo n.º 7
0
 public static uint hash(double3x3 v)
 {
     return(csum(fold_to_uint(v.c0) * uint3(0xAC5DB57Bu, 0xA91A02EDu, 0xB3C49313u) +
                 fold_to_uint(v.c1) * uint3(0xF43A9ABBu, 0x84E7E01Bu, 0x8E055BE5u) +
                 fold_to_uint(v.c2) * uint3(0x6E624EB7u, 0x7383ED49u, 0xDD49C23Bu)) + 0xEBD0D005u);
 }
Ejemplo n.º 8
0
 public static float3x3 float3x3(double3x3 v)
 {
     return(new float3x3(v));
 }
Ejemplo n.º 9
0
 public float3x3(double3x3 v)
 {
     this.c0 = (float3)v.c0;
     this.c1 = (float3)v.c1;
     this.c2 = (float3)v.c2;
 }
Ejemplo n.º 10
0
 public static int3x3 int3x3(double3x3 v)
 {
     return(new int3x3(v));
 }