예제 #1
0
        public static Matrix2x2 operator *(double value, Matrix2x2 matrix)
        {
            Matrix2x2 result = matrix;

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

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

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

            result.Subtract(rightMatrix);
            return(result);
        }
예제 #5
0
        public Matrix2x2 Divide(double value)
        {
            Matrix2x2 result = this;

            result.DivideAt(value);
            return(result);
        }
예제 #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;
        }
예제 #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;
        }
예제 #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;
        }
예제 #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;
        }
예제 #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);
        }
예제 #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);
        }
예제 #12
0
 public void SetMultiplicationOf(Matrix2x2 firstMatrix, Matrix2x2 secondMatrix)
 {
     this.Set(firstMatrix.Multiply(secondMatrix));
 }
예제 #13
0
 public void MultiplyAt(Matrix2x2 rightMatrix)
 {
     this.Set(this.Multiply(rightMatrix));
 }