rotate method

void rotate(
  1. double alpha
)

Implementation

void rotate(double alpha) {
  double alphaInRadians = alpha * (math.pi / 180);
  double oldX = x;
  x = x * math.cos(alphaInRadians) + y * math.sin(alphaInRadians);
  y = -oldX * math.sin(alphaInRadians) + y * math.cos(alphaInRadians);
}