Example #1
0
 private static Matrix3BR smethod_0(
     BigRational m00,
     BigRational m01,
     BigRational m02,
     BigRational m10,
     BigRational m11,
     BigRational m12,
     BigRational m20,
     BigRational m21,
     BigRational m22)
 {
     return(new Matrix3BR(m00, m01, m02, m10, m11, m12, m20, m21, m22));
 }
Example #2
0
        public BigRational 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!");
                }
            }
        }
Example #3
0
 public void Update(BigRational x, BigRational y)
 {
     if (this.point2BR_0.X > x)
     {
         this.point2BR_0.X = x;
     }
     if (this.point2BR_1.X < x)
     {
         this.point2BR_1.X = x;
     }
     if (this.point2BR_0.Y > y)
     {
         this.point2BR_0.Y = y;
     }
     if (!(this.point2BR_1.Y < y))
     {
         return;
     }
     this.point2BR_1.Y = y;
 }
Example #4
0
        public static int CompareAngles(Vector2BR a, Vector2BR b)
        {
            int quadrant1 = Vector2BR.GetQuadrant(a);
            int quadrant2 = Vector2BR.GetQuadrant(b);

            if (quadrant1 < quadrant2)
            {
                return(-1);
            }
            if (quadrant1 > quadrant2)
            {
                return(1);
            }
            BigRational bigRational = Vector2BR.CrossProduct(a, b);

            if (bigRational.IsNegative)
            {
                return(1);
            }
            return(bigRational.IsPositive ? -1 : 0);
        }
Example #5
0
 public Matrix3BR(
     double m00,
     double m01,
     double m02,
     double m10,
     double m11,
     double m12,
     double m20,
     double m21,
     double m22)
 {
     this.M00 = (BigRational)m00;
     this.M01 = (BigRational)m01;
     this.M02 = (BigRational)m02;
     this.M10 = (BigRational)m10;
     this.M11 = (BigRational)m11;
     this.M12 = (BigRational)m12;
     this.M20 = (BigRational)m20;
     this.M21 = (BigRational)m21;
     this.M22 = (BigRational)m22;
 }
Example #6
0
 public Matrix3BR(
     BigRational m00,
     BigRational m01,
     BigRational m02,
     BigRational m10,
     BigRational m11,
     BigRational m12,
     BigRational m20,
     BigRational m21,
     BigRational 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;
 }
Example #7
0
        public BigRational this[int index]
        {
            get
            {
                switch (index)
                {
                case 0:
                    return(this.X);

                case 1:
                    return(this.Y);

                case 2:
                    return(this.Z);

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

                case 1:
                    this.Y = value;
                    break;

                case 2:
                    this.Z = value;
                    break;

                default:
                    throw new IndexOutOfRangeException();
                }
            }
        }
Example #8
0
        public BigRational GetMinor(int removeRow, int removeColumn)
        {
            int         num1 = 0;
            BigRational zero = BigRational.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);
        }
Example #9
0
 public Vector3BR(Point3BR from)
 {
     this.X = from.X;
     this.Y = from.Y;
     this.Z = from.Z;
 }
Example #10
0
 public Point2BR(BigRational x, BigRational y)
 {
     this.X = x;
     this.Y = y;
 }
Example #11
0
        public Matrix2BR GetInverse()
        {
            BigRational determinant = this.GetDeterminant();

            return(new Matrix2BR(this.M11 / determinant, -this.M01 / determinant, -this.M10 / determinant, this.M00 / determinant));
        }
Example #12
0
        public static Vector4BR Divide(Vector4BR v, BigRational s)
        {
            BigRational bigRational = s.Invert();

            return(new Vector4BR(v.X * bigRational, v.Y * bigRational, v.Z * bigRational, v.W * bigRational));
        }
Example #13
0
 public static Vector4BR Multiply(Vector4BR u, BigRational s)
 {
     return(new Vector4BR(u.X * s, u.Y * s, u.Z * s, u.W * s));
 }
Example #14
0
 public static Vector2BR Divide(Vector2BR v, BigRational s)
 {
     return(new Vector2BR(v.X / s, v.Y / s));
 }
Example #15
0
 public Point2BR(double x, double y)
 {
     this.X = (BigRational)x;
     this.Y = (BigRational)y;
 }
Example #16
0
 public Point3BR(Point2BR point, BigRational z)
 {
     this.X = point.X;
     this.Y = point.Y;
     this.Z = z;
 }
Example #17
0
 public Vector2BR(double x, double y)
 {
     this.X = (BigRational)x;
     this.Y = (BigRational)y;
 }
Example #18
0
 private static Point3BR smethod_0(BigRational x, BigRational y, BigRational z)
 {
     return(new Point3BR(x, y, z));
 }
Example #19
0
 public Vector3BR(BigRational x, BigRational y, BigRational z)
 {
     this.X = x;
     this.Y = y;
     this.Z = z;
 }
Example #20
0
 public Vector3BR(IList <BigRational> coordinates)
 {
     this.X = coordinates[0];
     this.Y = coordinates[1];
     this.Z = coordinates[2];
 }
Example #21
0
 public Vector3BR(BigRational[] coordinates)
 {
     this.X = coordinates[0];
     this.Y = coordinates[1];
     this.Z = coordinates[2];
 }
Example #22
0
 public Vector3BR(Vector2BR vector, BigRational z)
 {
     this.X = vector.X;
     this.Y = vector.Y;
     this.Z = z;
 }
Example #23
0
 public Vector3BR(double x, double y, double z)
 {
     this.X = (BigRational)x;
     this.Y = (BigRational)y;
     this.Z = (BigRational)z;
 }
Example #24
0
 private static Vector3BR smethod_0(BigRational x, BigRational y, BigRational z)
 {
     return(new Vector3BR(x, y, z));
 }
Example #25
0
        public Matrix3BR GetInverse()
        {
            BigRational determinant = this.GetDeterminant();

            return(new Matrix3BR((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));
        }
Example #26
0
 public Point3BR(BigRational x, BigRational y, BigRational z)
 {
     this.X = x;
     this.Y = y;
     this.Z = z;
 }
Example #27
0
 public Vector2BR(BigRational x, BigRational y)
 {
     this.X = x;
     this.Y = y;
 }
Example #28
0
 public Point3BR(double x, double y, double z)
 {
     this.X = (BigRational)x;
     this.Y = (BigRational)y;
     this.Z = (BigRational)z;
 }
Example #29
0
 private static Vector2BR smethod_0(BigRational x, BigRational y)
 {
     return(new Vector2BR(x, y));
 }
Example #30
0
 public void Add(BigRational x, BigRational y, BigRational z)
 {
     this.X += x;
     this.Y += y;
     this.Z += z;
 }