コード例 #1
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 public Matrix2LR(LongRational[] elements)
 {
     this.M00 = elements[0];
     this.M01 = elements[1];
     this.M10 = elements[2];
     this.M11 = elements[3];
 }
コード例 #2
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 public Matrix2LR(Vector2LR column1, Vector2LR column2)
 {
     this.M00 = column1.X;
     this.M01 = column2.X;
     this.M10 = column1.Y;
     this.M11 = column2.Y;
 }
コード例 #3
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 public Matrix2LR(IList <LongRational> elements)
 {
     this.M00 = elements[0];
     this.M01 = elements[1];
     this.M10 = elements[2];
     this.M11 = elements[3];
 }
コード例 #4
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
        public Matrix3LR GetInverse(out bool couldInvert)
        {
            LongRational determinant = this.GetDeterminant();

            couldInvert = !determinant.IsZero;
            return(new Matrix3LR((this.M11 * this.M22 - this.M12 * this.M21) / determinant, -(this.M01 * this.M22 - this.M02 * this.M21) / determinant, (this.M01 * this.M12 - this.M02 * this.M11) / determinant, -(this.M10 * this.M22 - this.M12 * this.M20) / determinant, (this.M00 * this.M22 - this.M02 * this.M20) / determinant, -(this.M00 * this.M12 - this.M02 * this.M10) / determinant, (this.M10 * this.M21 - this.M11 * this.M20) / determinant, -(this.M00 * this.M21 - this.M01 * this.M20) / determinant, (this.M00 * this.M11 - this.M01 * this.M10) / determinant));
        }
コード例 #5
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 public Matrix2LR(Matrix2LR m)
 {
     this.M00 = m.M00;
     this.M01 = m.M01;
     this.M10 = m.M10;
     this.M11 = m.M11;
 }
コード例 #6
0
 public Vector4LR(Vector4LR from)
 {
     this.X = from.X;
     this.Y = from.Y;
     this.Z = from.Z;
     this.W = from.W;
 }
コード例 #7
0
        public LongRational this[int index]
        {
            get
            {
                switch (index)
                {
                case 0:
                    return(this.X);

                case 1:
                    return(this.Y);

                default:
                    throw new IndexOutOfRangeException();
                }
            }
            set
            {
                switch (index)
                {
                case 0:
                    this.X = value;
                    break;

                case 1:
                    this.Y = value;
                    break;

                default:
                    throw new IndexOutOfRangeException();
                }
            }
        }
コード例 #8
0
 public Vector4LR(int x, int y, int z, int w)
 {
     this.X = new LongRational(x);
     this.Y = new LongRational(y);
     this.Z = new LongRational(z);
     this.W = new LongRational(w);
 }
コード例 #9
0
 public Vector4LR(IList <LongRational> coordinates)
 {
     this.X = coordinates[0];
     this.Y = coordinates[1];
     this.Z = coordinates[2];
     this.W = coordinates[3];
 }
コード例 #10
0
 public Vector4LR(double x, double y, double z, double w)
 {
     this.X = (LongRational)x;
     this.Y = (LongRational)y;
     this.Z = (LongRational)z;
     this.W = (LongRational)w;
 }
コード例 #11
0
 public Vector4LR(LongRational x, LongRational y, LongRational z, LongRational w)
 {
     this.X = x;
     this.Y = y;
     this.Z = z;
     this.W = w;
 }
コード例 #12
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 public Matrix2LR(LongRational m00, LongRational m01, LongRational m10, LongRational m11)
 {
     this.M00 = m00;
     this.M01 = m01;
     this.M10 = m10;
     this.M11 = m11;
 }
コード例 #13
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
        public Matrix2LR GetInverse(out bool couldInvert)
        {
            LongRational determinant = this.GetDeterminant();

            couldInvert = !determinant.IsZero;
            return(new Matrix2LR(this.M11 / determinant, -this.M01 / determinant, -this.M10 / determinant, this.M00 / determinant));
        }
コード例 #14
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
 private static Matrix2LR smethod_0(
     LongRational m00,
     LongRational m01,
     LongRational m10,
     LongRational m11)
 {
     return(new Matrix2LR(m00, m01, m10, m11));
 }
コード例 #15
0
 private static Vector4LR smethod_0(
     LongRational x,
     LongRational y,
     LongRational z,
     LongRational w)
 {
     return(new Vector4LR(x, y, z, w));
 }
コード例 #16
0
 public void Move(LongRational deltaX, LongRational deltaY)
 {
     if (!this.Initialized)
     {
         return;
     }
     this.point2LR_0.X += deltaX;
     this.point2LR_0.Y += deltaY;
     this.point2LR_1.X += deltaX;
     this.point2LR_1.Y += deltaY;
 }
コード例 #17
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 public Matrix3LR(IList <LongRational> elements)
 {
     this.M00 = elements[0];
     this.M01 = elements[1];
     this.M02 = elements[2];
     this.M10 = elements[3];
     this.M11 = elements[4];
     this.M12 = elements[5];
     this.M20 = elements[6];
     this.M21 = elements[7];
     this.M22 = elements[8];
 }
コード例 #18
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 public Matrix3LR(Matrix3LR m)
 {
     this.M00 = m.M00;
     this.M01 = m.M01;
     this.M02 = m.M02;
     this.M10 = m.M10;
     this.M11 = m.M11;
     this.M12 = m.M12;
     this.M20 = m.M20;
     this.M21 = m.M21;
     this.M22 = m.M22;
 }
コード例 #19
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 public Matrix3LR(Vector3LR column1, Vector3LR column2, Vector3LR column3)
 {
     this.M00 = column1.X;
     this.M01 = column2.X;
     this.M02 = column3.X;
     this.M10 = column1.Y;
     this.M11 = column2.Y;
     this.M12 = column3.Y;
     this.M20 = column1.Z;
     this.M21 = column2.Z;
     this.M22 = column3.Z;
 }
コード例 #20
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 private static Matrix3LR smethod_0(
     LongRational m00,
     LongRational m01,
     LongRational m02,
     LongRational m10,
     LongRational m11,
     LongRational m12,
     LongRational m20,
     LongRational m21,
     LongRational m22)
 {
     return(new Matrix3LR(m00, m01, m02, m10, m11, m12, m20, m21, m22));
 }
コード例 #21
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
        public LongRational this[int index]
        {
            get
            {
                switch (index)
                {
                case 0:
                    return(this.M00);

                case 1:
                    return(this.M01);

                case 2:
                    return(this.M10);

                case 3:
                    return(this.M11);

                default:
                    throw new IndexOutOfRangeException("Invalid matrix index!");
                }
            }
            set
            {
                switch (index)
                {
                case 0:
                    this.M00 = value;
                    break;

                case 1:
                    this.M01 = value;
                    break;

                case 2:
                    this.M10 = value;
                    break;

                case 3:
                    this.M11 = value;
                    break;

                default:
                    throw new IndexOutOfRangeException("Invalid matrix index!");
                }
            }
        }
コード例 #22
0
 public void Update(LongRational x, LongRational y)
 {
     if (this.point2LR_0.X > x)
     {
         this.point2LR_0.X = x;
     }
     if (this.point2LR_1.X < x)
     {
         this.point2LR_1.X = x;
     }
     if (this.point2LR_0.Y > y)
     {
         this.point2LR_0.Y = y;
     }
     if (!(this.point2LR_1.Y < y))
     {
         return;
     }
     this.point2LR_1.Y = y;
 }
コード例 #23
0
        public static int CompareAngles(Vector2LR a, Vector2LR b)
        {
            int quadrant1 = Vector2LR.GetQuadrant(a);
            int quadrant2 = Vector2LR.GetQuadrant(b);

            if (quadrant1 < quadrant2)
            {
                return(-1);
            }
            if (quadrant1 > quadrant2)
            {
                return(1);
            }
            LongRational longRational = Vector2LR.CrossProduct(a, b);

            if (longRational.IsNegative)
            {
                return(1);
            }
            return(longRational.IsPositive ? -1 : 0);
        }
コード例 #24
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 public Matrix3LR(
     double m00,
     double m01,
     double m02,
     double m10,
     double m11,
     double m12,
     double m20,
     double m21,
     double m22)
 {
     this.M00 = (LongRational)m00;
     this.M01 = (LongRational)m01;
     this.M02 = (LongRational)m02;
     this.M10 = (LongRational)m10;
     this.M11 = (LongRational)m11;
     this.M12 = (LongRational)m12;
     this.M20 = (LongRational)m20;
     this.M21 = (LongRational)m21;
     this.M22 = (LongRational)m22;
 }
コード例 #25
0
ファイル: Matrix3LR.cs プロジェクト: 15831944/WW
 public Matrix3LR(
     LongRational m00,
     LongRational m01,
     LongRational m02,
     LongRational m10,
     LongRational m11,
     LongRational m12,
     LongRational m20,
     LongRational m21,
     LongRational m22)
 {
     this.M00 = m00;
     this.M01 = m01;
     this.M02 = m02;
     this.M10 = m10;
     this.M11 = m11;
     this.M12 = m12;
     this.M20 = m20;
     this.M21 = m21;
     this.M22 = m22;
 }
コード例 #26
0
ファイル: Matrix2LR.cs プロジェクト: 15831944/WW
        public LongRational GetMinor(int removeRow, int removeColumn)
        {
            int          num1 = 0;
            LongRational zero = LongRational.Zero;

            for (int index1 = 0; index1 < 2; ++index1)
            {
                int num2 = 0;
                if (index1 != removeRow)
                {
                    for (int index2 = 0; index2 < 2; ++index2)
                    {
                        if (index2 != removeColumn)
                        {
                            zero = this[index1, index2];
                            ++num2;
                        }
                    }
                    ++num1;
                }
            }
            return(zero);
        }
コード例 #27
0
 public static Vector2LR Multiply(Vector2LR u, LongRational s)
 {
     return(new Vector2LR(u.X * s, u.Y * s));
 }
コード例 #28
0
 public static Vector2LR Divide(Vector2LR v, LongRational s)
 {
     return(new Vector2LR(v.X / s, v.Y / s));
 }
コード例 #29
0
 public Vector2LR(int x, int y)
 {
     this.X = new LongRational(x);
     this.Y = new LongRational(y);
 }
コード例 #30
0
 public Vector2LR(double x, double y)
 {
     this.X = (LongRational)x;
     this.Y = (LongRational)y;
 }