setToRotation method

AffineTransformation setToRotation(
  1. double theta
)

Sets this transformation to be a rotation around the origin. A positive rotation angle corresponds to a counter-clockwise rotation. The transformation matrix for a rotation by an angle theta has the value:

  
|  cos(theta)  -sin(theta)   0 |
|  sin(theta)   cos(theta)   0 |
|           0            0   1 |

@param theta the rotation angle, in radians @return this transformation, with an updated matrix

Implementation

AffineTransformation setToRotation(double theta) {
  setToRotationSinCos(math.sin(theta), math.cos(theta));
  return this;
}