public static Matrix2x2 operator *(double value, Matrix2x2 matrix) { Matrix2x2 result = matrix; result.MultiplyAt(value); return(result); }
public static Matrix2x2 operator /(Matrix2x2 matrix, double value) { Matrix2x2 result = matrix; result.DivideAt(value); return(result); }
public static Matrix2x2 operator +(Matrix2x2 leftMatrix, Matrix2x2 rightMatrix) { Matrix2x2 result = leftMatrix; result.Add(rightMatrix); return(result); }
public static Matrix2x2 operator -(Matrix2x2 leftMatrix, Matrix2x2 rightMatrix) { Matrix2x2 result = leftMatrix; result.Subtract(rightMatrix); return(result); }
public Matrix2x2 Divide(double value) { Matrix2x2 result = this; result.DivideAt(value); return(result); }
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; }
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; }
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; }
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; }
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); }
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); }
public void SetMultiplicationOf(Matrix2x2 firstMatrix, Matrix2x2 secondMatrix) { this.Set(firstMatrix.Multiply(secondMatrix)); }
public void MultiplyAt(Matrix2x2 rightMatrix) { this.Set(this.Multiply(rightMatrix)); }