setToTranslation method

AffineTransformation setToTranslation(
  1. double dx,
  2. double dy
)

Sets this transformation to be a translation. For a translation by the vector (x, y) the transformation matrix has the value:

  
|  1  0  dx |
|  1  0  dy |
|  0  0   1 |
@param dx the x component to translate by @param dy the y component to translate by @return this transformation, with an updated matrix

Implementation

AffineTransformation setToTranslation(double dx, double dy) {
  m00 = 1.0;
  m01 = 0.0;
  m02 = dx;
  m10 = 0.0;
  m11 = 1.0;
  m12 = dy;
  return this;
}