setToRotationSinCos method

AffineTransformation setToRotationSinCos(
  1. double sinTheta,
  2. double cosTheta
)

Sets this transformation to be a rotation around the origin by specifying the sin and cos of the rotation angle directly. The transformation matrix for the rotation has the value:

  
|  cosTheta  -sinTheta   0 |
|  sinTheta   cosTheta   0 |
|         0          0   1 |

@param sinTheta the sine of the rotation angle @param cosTheta the cosine of the rotation angle @return this transformation, with an updated matrix

Implementation

AffineTransformation setToRotationSinCos(double sinTheta, double cosTheta) {
  m00 = cosTheta;
  m01 = -sinTheta;
  m02 = 0.0;
  m10 = sinTheta;
  m11 = cosTheta;
  m12 = 0.0;
  return this;
}