Пример #1
0
 public fp2x4(uint v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
     this.c2 = (fp2)v;
     this.c3 = (fp2)v;
 }
Пример #2
0
 public fp2x3(fp m00, fp m01, fp m02,
              fp m10, fp m11, fp m12)
 {
     this.c0 = new fp2(m00, m10);
     this.c1 = new fp2(m01, m11);
     this.c2 = new fp2(m02, m12);
 }
Пример #3
0
 public static fp3 mul(fp2 a, fp2x3 b)
 {
     return(fp3(
                a.x * b.c0.x + a.y * b.c0.y,
                a.x * b.c1.x + a.y * b.c1.y,
                a.x * b.c2.x + a.y * b.c2.y));
 }
Пример #4
0
 public fp2x4(fp2 c0, fp2 c1, fp2 c2, fp2 c3)
 {
     this.c0 = c0;
     this.c1 = c1;
     this.c2 = c2;
     this.c3 = c3;
 }
Пример #5
0
 public fp2x4(fp v)
 {
     this.c0 = v;
     this.c1 = v;
     this.c2 = v;
     this.c3 = v;
 }
Пример #6
0
 public static fp3 shuffle(fp2 a, fp2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(fp3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #7
0
 public fp2x4(uint2x4 v)
 {
     this.c0 = (fp2)v.c0;
     this.c1 = (fp2)v.c1;
     this.c2 = (fp2)v.c2;
     this.c3 = (fp2)v.c3;
 }
Пример #8
0
 public static fp4 mul(fp2 a, fp2x4 b)
 {
     return(fp4(
                a.x * b.c0.x + a.y * b.c0.y,
                a.x * b.c1.x + a.y * b.c1.y,
                a.x * b.c2.x + a.y * b.c2.y,
                a.x * b.c3.x + a.y * b.c3.y));
 }
Пример #9
0
 public static fp4 shuffle(fp2 a, fp2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(fp4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #10
0
 public fp2x4(fp m00, fp m01, fp m02, fp m03,
              fp m10, fp m11, fp m12, fp m13)
 {
     this.c0 = new fp2(m00, m10);
     this.c1 = new fp2(m01, m11);
     this.c2 = new fp2(m02, m12);
     this.c3 = new fp2(m03, m13);
 }
Пример #11
0
        internal static fp select_shuffle_component(fp2 a, fp2 b, ShuffleComponent component)
        {
            switch (component)
            {
            case ShuffleComponent.LeftX:
                return(a.x);

            case ShuffleComponent.LeftY:
                return(a.y);

            case ShuffleComponent.RightX:
                return(b.x);

            case ShuffleComponent.RightY:
                return(b.y);

            default:
                throw new System.ArgumentException("Invalid shuffle component: " + component);
            }
        }
Пример #12
0
 public fp2x2(uint2x2 v)
 {
     this.c0 = (fp2)v.c0;
     this.c1 = (fp2)v.c1;
 }
Пример #13
0
 public fp2x2(uint v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
 }
Пример #14
0
 public fp2x2(fp v)
 {
     this.c0 = v;
     this.c1 = v;
 }
Пример #15
0
 public static fp2x2 fp2x2(fp2 c0, fp2 c1)
 {
     return(new fp2x2(c0, c1));
 }
Пример #16
0
 public fp2x2(fp m00, fp m01,
              fp m10, fp m11)
 {
     this.c0 = new fp2(m00, m10);
     this.c1 = new fp2(m01, m11);
 }
Пример #17
0
 public fp2x2(fp2 c0, fp2 c1)
 {
     this.c0 = c0;
     this.c1 = c1;
 }
Пример #18
0
        public static fp Angle(fp2 lhs, fp2 rhs)
        {
            var num = fpmath.sqrt(lhs.sqrMagnitude * rhs.sqrMagnitude);

            return(num < fp.precision ? fp.zero : fpmath.degrees(fpmath.acos(fpmath.clamp(fpmath.dot(lhs, rhs) / num, -fp.one, fp.one))));
        }
Пример #19
0
 public static fp mul(fp2 a, fp2 b)
 {
     return(a.x * b.x + a.y * b.y);
 }
Пример #20
0
 public static fp2x3 fp2x3(fp2 c0, fp2 c1, fp2 c2)
 {
     return(new fp2x3(c0, c1, c2));
 }
Пример #21
0
 public static fp2 mul(fp2 a, fp2x2 b)
 {
     return(fp2(
                a.x * b.c0.x + a.y * b.c0.y,
                a.x * b.c1.x + a.y * b.c1.y));
 }
Пример #22
0
 public static fp2x4 fp2x4(fp2 c0, fp2 c1, fp2 c2, fp2 c3)
 {
     return(new fp2x4(c0, c1, c2, c3));
 }
Пример #23
0
 public fp2x3(fp2 c0, fp2 c1, fp2 c2)
 {
     this.c0 = c0;
     this.c1 = c1;
     this.c2 = c2;
 }
Пример #24
0
 public static fp SignedAngle(fp2 lhs, fp2 rhs)
 {
     return(VecMath.Angle(lhs, rhs) * fpmath.sign(lhs.x * rhs.y - lhs.y * rhs.x));
 }
Пример #25
0
 public fp2x3(int v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
     this.c2 = (fp2)v;
 }
Пример #26
0
 public static fp4 mul(fp4x2 a, fp2 b)
 {
     return(a.c0 * b.x + a.c1 * b.y);
 }
Пример #27
0
 public fp2x3(fp v)
 {
     this.c0 = v;
     this.c1 = v;
     this.c2 = v;
 }
Пример #28
0
 public static fp2 Lerp(fp2 lhs, fp2 rhs, fp t)
 {
     return(fpmath.lerp(lhs, rhs, t));
 }
Пример #29
0
 public fp2x3(uint2x3 v)
 {
     this.c0 = (fp2)v.c0;
     this.c1 = (fp2)v.c1;
     this.c2 = (fp2)v.c2;
 }
Пример #30
0
 public static fp2 shuffle(fp2 a, fp2 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(fp2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }