示例#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)));
 }