@Test public void testTransform() { Matrix33 matrix=Matrix33.makeTranslate(2, 5); Vector2 vector = new Vector2(3,4); Vector2 v = matrix.transform(vector); assertTrue(5==v.getX()); assertTrue(9==v.getY()); }
public Vector2 transform(Vector2 vector) { double x = m[0][0] * vector.getX() + m[0][1] * vector.getY() + m[0][2]; double y = m[1][0] * vector.getX() + m[1][1] * vector.getY() + m[1][2]; return new Vector2 ( x, y ); }
Matrix33 { public Vector2 transform(Vector2 vector) { double x = m[0][0] * vector.getX() + m[0][1] * vector.getY() + m[0][2]; double y = m[1][0] * vector.getX() + m[1][1] * vector.getY() + m[1][2]; return new Vector2 ( x, y ); } }
Matrix33 { public Vector2 transform(Vector2 vector) { double x = m[0][0] * vector.getX() + m[0][1] * vector.getY() + m[0][2]; double y = m[1][0] * vector.getX() + m[1][1] * vector.getY() + m[1][2]; return new Vector2 ( x, y ); } Matrix33();  Matrix33(double m00, double m01, double m02, 
	                double m10, double m11, double m12,
	                double m20, double m21, double m22); }
Matrix33 { public Vector2 transform(Vector2 vector) { double x = m[0][0] * vector.getX() + m[0][1] * vector.getY() + m[0][2]; double y = m[1][0] * vector.getX() + m[1][1] * vector.getY() + m[1][2]; return new Vector2 ( x, y ); } 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 Vector2 transform(Vector2 vector) { double x = m[0][0] * vector.getX() + m[0][1] * vector.getY() + m[0][2]; double y = m[1][0] * vector.getX() + m[1][1] * vector.getY() + m[1][2]; return new Vector2 ( x, y ); } 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();  }