@Test public void testMultiply() { Matrix33 S0=Matrix33.makeScale(5, 10); Matrix33 S1=Matrix33.makeScale(5, 10); Matrix33 result0=S0.multiply(S1); assertTrue(25==result0.get(0,0)); assertTrue(100==result0.get(1,1)); }
public Matrix33 multiply(Matrix33 rhs) { double m00 = this.m[0][0] * rhs.m[0][0] + this.m[0][1] * rhs.m[1][0] + this.m[0][2] * rhs.m[2][0]; double m01 = this.m[0][0] * rhs.m[0][1] + this.m[0][1] * rhs.m[1][1] + this.m[0][2] * rhs.m[2][1]; double m02 = this.m[0][0] * rhs.m[0][2] + this.m[0][1] * rhs.m[1][2] + this.m[0][2] * rhs.m[2][2]; double m10 = this.m[1][0] * rhs.m[1][0] + this.m[1][1] * rhs.m[1][0] + this.m[1][2] * rhs.m[2][0]; double m11 = this.m[1][0] * rhs.m[0][1] + this.m[1][1] * rhs.m[1][1] + this.m[1][2] * rhs.m[2][1]; double m12 = this.m[1][0] * rhs.m[0][2] + this.m[1][1] * rhs.m[1][2] + this.m[1][2] * rhs.m[2][2]; double m20 = this.m[2][0] * rhs.m[1][0] + this.m[2][1] * rhs.m[1][0] + this.m[2][2] * rhs.m[2][0]; double m21 = this.m[2][0] * rhs.m[0][1] + this.m[2][1] * rhs.m[1][1] + this.m[2][2] * rhs.m[2][1]; double m22 = this.m[2][0] * rhs.m[0][2] + this.m[2][1] * rhs.m[1][2] + this.m[2][2] * rhs.m[2][2]; return new Matrix33(m00,m01,m02,m10,m11,m12,m20,m21,m22); }
Matrix33 { public Matrix33 multiply(Matrix33 rhs) { double m00 = this.m[0][0] * rhs.m[0][0] + this.m[0][1] * rhs.m[1][0] + this.m[0][2] * rhs.m[2][0]; double m01 = this.m[0][0] * rhs.m[0][1] + this.m[0][1] * rhs.m[1][1] + this.m[0][2] * rhs.m[2][1]; double m02 = this.m[0][0] * rhs.m[0][2] + this.m[0][1] * rhs.m[1][2] + this.m[0][2] * rhs.m[2][2]; double m10 = this.m[1][0] * rhs.m[1][0] + this.m[1][1] * rhs.m[1][0] + this.m[1][2] * rhs.m[2][0]; double m11 = this.m[1][0] * rhs.m[0][1] + this.m[1][1] * rhs.m[1][1] + this.m[1][2] * rhs.m[2][1]; double m12 = this.m[1][0] * rhs.m[0][2] + this.m[1][1] * rhs.m[1][2] + this.m[1][2] * rhs.m[2][2]; double m20 = this.m[2][0] * rhs.m[1][0] + this.m[2][1] * rhs.m[1][0] + this.m[2][2] * rhs.m[2][0]; double m21 = this.m[2][0] * rhs.m[0][1] + this.m[2][1] * rhs.m[1][1] + this.m[2][2] * rhs.m[2][1]; double m22 = this.m[2][0] * rhs.m[0][2] + this.m[2][1] * rhs.m[1][2] + this.m[2][2] * rhs.m[2][2]; return new Matrix33(m00,m01,m02,m10,m11,m12,m20,m21,m22); } }
Matrix33 { public Matrix33 multiply(Matrix33 rhs) { double m00 = this.m[0][0] * rhs.m[0][0] + this.m[0][1] * rhs.m[1][0] + this.m[0][2] * rhs.m[2][0]; double m01 = this.m[0][0] * rhs.m[0][1] + this.m[0][1] * rhs.m[1][1] + this.m[0][2] * rhs.m[2][1]; double m02 = this.m[0][0] * rhs.m[0][2] + this.m[0][1] * rhs.m[1][2] + this.m[0][2] * rhs.m[2][2]; double m10 = this.m[1][0] * rhs.m[1][0] + this.m[1][1] * rhs.m[1][0] + this.m[1][2] * rhs.m[2][0]; double m11 = this.m[1][0] * rhs.m[0][1] + this.m[1][1] * rhs.m[1][1] + this.m[1][2] * rhs.m[2][1]; double m12 = this.m[1][0] * rhs.m[0][2] + this.m[1][1] * rhs.m[1][2] + this.m[1][2] * rhs.m[2][2]; double m20 = this.m[2][0] * rhs.m[1][0] + this.m[2][1] * rhs.m[1][0] + this.m[2][2] * rhs.m[2][0]; double m21 = this.m[2][0] * rhs.m[0][1] + this.m[2][1] * rhs.m[1][1] + this.m[2][2] * rhs.m[2][1]; double m22 = this.m[2][0] * rhs.m[0][2] + this.m[2][1] * rhs.m[1][2] + this.m[2][2] * rhs.m[2][2]; return new Matrix33(m00,m01,m02,m10,m11,m12,m20,m21,m22); } Matrix33();  Matrix33(double m00, double m01, double m02, 
	                double m10, double m11, double m12,
	                double m20, double m21, double m22); }
Matrix33 { public Matrix33 multiply(Matrix33 rhs) { double m00 = this.m[0][0] * rhs.m[0][0] + this.m[0][1] * rhs.m[1][0] + this.m[0][2] * rhs.m[2][0]; double m01 = this.m[0][0] * rhs.m[0][1] + this.m[0][1] * rhs.m[1][1] + this.m[0][2] * rhs.m[2][1]; double m02 = this.m[0][0] * rhs.m[0][2] + this.m[0][1] * rhs.m[1][2] + this.m[0][2] * rhs.m[2][2]; double m10 = this.m[1][0] * rhs.m[1][0] + this.m[1][1] * rhs.m[1][0] + this.m[1][2] * rhs.m[2][0]; double m11 = this.m[1][0] * rhs.m[0][1] + this.m[1][1] * rhs.m[1][1] + this.m[1][2] * rhs.m[2][1]; double m12 = this.m[1][0] * rhs.m[0][2] + this.m[1][1] * rhs.m[1][2] + this.m[1][2] * rhs.m[2][2]; double m20 = this.m[2][0] * rhs.m[1][0] + this.m[2][1] * rhs.m[1][0] + this.m[2][2] * rhs.m[2][0]; double m21 = this.m[2][0] * rhs.m[0][1] + this.m[2][1] * rhs.m[1][1] + this.m[2][2] * rhs.m[2][1]; double m22 = this.m[2][0] * rhs.m[0][2] + this.m[2][1] * rhs.m[1][2] + this.m[2][2] * rhs.m[2][2]; return new Matrix33(m00,m01,m02,m10,m11,m12,m20,m21,m22); } Matrix33();  Matrix33(double m00, double m01, double m02, 
	                double m10, double m11, double m12,
	                double m20, double m21, double m22); static Matrix33 makeTranslate(double x, double y); static Matrix33 makeScale(double sx, double sy ); void set(double m00, double m01, double m02, 
			        double m10, double m11, double m12,
			        double m20, double m21, double m22 ); Vector2 transform(Vector2 vector); Box2D transform(Box2D box); Matrix33 multiply(Matrix33 rhs); double determinant(); Matrix33 inverse(); void set(int row, int col,double value); double get(int row, int col); void setTranslationX(double value); void setTranslationY(double value); double getTranslationX(); double getTranslationY(); double getScaleX(); double getScaleY(); double getShearX(); double getShearY(); String toString(); }
Matrix33 { public Matrix33 multiply(Matrix33 rhs) { double m00 = this.m[0][0] * rhs.m[0][0] + this.m[0][1] * rhs.m[1][0] + this.m[0][2] * rhs.m[2][0]; double m01 = this.m[0][0] * rhs.m[0][1] + this.m[0][1] * rhs.m[1][1] + this.m[0][2] * rhs.m[2][1]; double m02 = this.m[0][0] * rhs.m[0][2] + this.m[0][1] * rhs.m[1][2] + this.m[0][2] * rhs.m[2][2]; double m10 = this.m[1][0] * rhs.m[1][0] + this.m[1][1] * rhs.m[1][0] + this.m[1][2] * rhs.m[2][0]; double m11 = this.m[1][0] * rhs.m[0][1] + this.m[1][1] * rhs.m[1][1] + this.m[1][2] * rhs.m[2][1]; double m12 = this.m[1][0] * rhs.m[0][2] + this.m[1][1] * rhs.m[1][2] + this.m[1][2] * rhs.m[2][2]; double m20 = this.m[2][0] * rhs.m[1][0] + this.m[2][1] * rhs.m[1][0] + this.m[2][2] * rhs.m[2][0]; double m21 = this.m[2][0] * rhs.m[0][1] + this.m[2][1] * rhs.m[1][1] + this.m[2][2] * rhs.m[2][1]; double m22 = this.m[2][0] * rhs.m[0][2] + this.m[2][1] * rhs.m[1][2] + this.m[2][2] * rhs.m[2][2]; return new Matrix33(m00,m01,m02,m10,m11,m12,m20,m21,m22); } Matrix33();  Matrix33(double m00, double m01, double m02, 
	                double m10, double m11, double m12,
	                double m20, double m21, double m22); static Matrix33 makeTranslate(double x, double y); static Matrix33 makeScale(double sx, double sy ); void set(double m00, double m01, double m02, 
			        double m10, double m11, double m12,
			        double m20, double m21, double m22 ); Vector2 transform(Vector2 vector); Box2D transform(Box2D box); Matrix33 multiply(Matrix33 rhs); double determinant(); Matrix33 inverse(); void set(int row, int col,double value); double get(int row, int col); void setTranslationX(double value); void setTranslationY(double value); double getTranslationX(); double getTranslationY(); double getScaleX(); double getScaleY(); double getShearX(); double getShearY(); String toString();  }