Example #1
0
 public fp2x4(uint v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
     this.c2 = (fp2)v;
     this.c3 = (fp2)v;
 }
Example #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);
 }
Example #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));
 }
Example #4
0
 public fp2x4(fp2 c0, fp2 c1, fp2 c2, fp2 c3)
 {
     this.c0 = c0;
     this.c1 = c1;
     this.c2 = c2;
     this.c3 = c3;
 }
Example #5
0
 public fp2x4(fp v)
 {
     this.c0 = v;
     this.c1 = v;
     this.c2 = v;
     this.c3 = v;
 }
Example #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)));
 }
Example #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;
 }
Example #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));
 }
Example #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)));
 }
Example #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);
 }
Example #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);
            }
        }
Example #12
0
 public fp2x2(uint2x2 v)
 {
     this.c0 = (fp2)v.c0;
     this.c1 = (fp2)v.c1;
 }
Example #13
0
 public fp2x2(uint v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
 }
Example #14
0
 public fp2x2(fp v)
 {
     this.c0 = v;
     this.c1 = v;
 }
Example #15
0
 public static fp2x2 fp2x2(fp2 c0, fp2 c1)
 {
     return(new fp2x2(c0, c1));
 }
Example #16
0
 public fp2x2(fp m00, fp m01,
              fp m10, fp m11)
 {
     this.c0 = new fp2(m00, m10);
     this.c1 = new fp2(m01, m11);
 }
Example #17
0
 public fp2x2(fp2 c0, fp2 c1)
 {
     this.c0 = c0;
     this.c1 = c1;
 }
Example #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))));
        }
Example #19
0
 public static fp mul(fp2 a, fp2 b)
 {
     return(a.x * b.x + a.y * b.y);
 }
Example #20
0
 public static fp2x3 fp2x3(fp2 c0, fp2 c1, fp2 c2)
 {
     return(new fp2x3(c0, c1, c2));
 }
Example #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));
 }
Example #22
0
 public static fp2x4 fp2x4(fp2 c0, fp2 c1, fp2 c2, fp2 c3)
 {
     return(new fp2x4(c0, c1, c2, c3));
 }
Example #23
0
 public fp2x3(fp2 c0, fp2 c1, fp2 c2)
 {
     this.c0 = c0;
     this.c1 = c1;
     this.c2 = c2;
 }
Example #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));
 }
Example #25
0
 public fp2x3(int v)
 {
     this.c0 = (fp2)v;
     this.c1 = (fp2)v;
     this.c2 = (fp2)v;
 }
Example #26
0
 public static fp4 mul(fp4x2 a, fp2 b)
 {
     return(a.c0 * b.x + a.c1 * b.y);
 }
Example #27
0
 public fp2x3(fp v)
 {
     this.c0 = v;
     this.c1 = v;
     this.c2 = v;
 }
Example #28
0
 public static fp2 Lerp(fp2 lhs, fp2 rhs, fp t)
 {
     return(fpmath.lerp(lhs, rhs, t));
 }
Example #29
0
 public fp2x3(uint2x3 v)
 {
     this.c0 = (fp2)v.c0;
     this.c1 = (fp2)v.c1;
     this.c2 = (fp2)v.c2;
 }
Example #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)));
 }