Esempio n. 1
0
        public static Matrix2x2 operator *(double value, Matrix2x2 matrix)
        {
            Matrix2x2 result = matrix;

            result.MultiplyAt(value);
            return(result);
        }
Esempio n. 2
0
        public static Matrix2x2 operator /(Matrix2x2 matrix, double value)
        {
            Matrix2x2 result = matrix;

            result.DivideAt(value);
            return(result);
        }
Esempio n. 3
0
        public static Matrix2x2 operator +(Matrix2x2 leftMatrix, Matrix2x2 rightMatrix)
        {
            Matrix2x2 result = leftMatrix;

            result.Add(rightMatrix);
            return(result);
        }
Esempio n. 4
0
        public static Matrix2x2 operator -(Matrix2x2 leftMatrix, Matrix2x2 rightMatrix)
        {
            Matrix2x2 result = leftMatrix;

            result.Subtract(rightMatrix);
            return(result);
        }
Esempio n. 5
0
        public Matrix2x2 Divide(double value)
        {
            Matrix2x2 result = this;

            result.DivideAt(value);
            return(result);
        }
Esempio n. 6
0
        public Matrix2x2(Matrix2x2 matrix)
        {
            this.a_1_1 = matrix.a_1_1;
            this.a_1_2 = matrix.a_1_2;

            this.a_2_1 = matrix.a_2_1;
            this.a_2_2 = matrix.a_2_2;
        }
Esempio n. 7
0
        public void Subtract(Matrix2x2 matrix)
        {
            this.a_1_1 -= matrix.a_1_1;
            this.a_1_2 -= matrix.a_1_2;

            this.a_2_1 -= matrix.a_2_1;
            this.a_2_2 -= matrix.a_2_2;
        }
Esempio n. 8
0
        public void Add(Matrix2x2 matrix)
        {
            this.a_1_1 += matrix.a_1_1;
            this.a_1_2 += matrix.a_1_2;

            this.a_2_1 += matrix.a_2_1;
            this.a_2_2 += matrix.a_2_2;
        }
Esempio n. 9
0
        public void Set(Matrix2x2 matrix)
        {
            this.a_1_1 = matrix.a_1_1;
            this.a_1_2 = matrix.a_1_2;

            this.a_2_1 = matrix.a_2_1;
            this.a_2_2 = matrix.a_2_2;
        }
Esempio n. 10
0
        public Matrix2x2 Multiply(Matrix2x2 rightMatrix)
        {
            Matrix2x2 result = new Matrix2x2();

            result.a_1_1 = this.a_1_1 * rightMatrix.a_1_1 + this.a_1_2 * rightMatrix.a_2_1;
            result.a_1_2 = this.a_1_1 * rightMatrix.a_1_2 + this.a_1_2 * rightMatrix.a_2_2;

            result.a_2_1 = this.a_2_1 * rightMatrix.a_1_1 + this.a_2_2 * rightMatrix.a_2_1;
            result.a_2_2 = this.a_2_1 * rightMatrix.a_1_2 + this.a_2_2 * rightMatrix.a_2_2;

            return(result);
        }
Esempio n. 11
0
        public Matrix2x2 GetBackwardRotationMatrix()
        {
            double cos = this.Cos();
            double sin = this.Sin();

            Matrix2x2 result = new Matrix2x2();

            result.a_1_1 = cos;
            result.a_1_2 = sin;

            result.a_2_1 = -sin;
            result.a_2_2 = cos;

            return(result);
        }
Esempio n. 12
0
 public void SetMultiplicationOf(Matrix2x2 firstMatrix, Matrix2x2 secondMatrix)
 {
     this.Set(firstMatrix.Multiply(secondMatrix));
 }
Esempio n. 13
0
 public void MultiplyAt(Matrix2x2 rightMatrix)
 {
     this.Set(this.Multiply(rightMatrix));
 }