getRotate method

EVector2D getRotate(
  1. double alpha
)

Implementation

EVector2D getRotate(double alpha) {
  double alphaInRadians = alpha * (math.pi / 180);
  double newX = x * math.cos(alphaInRadians) + y * math.sin(alphaInRadians);
  double newY = -x * math.sin(alphaInRadians) + y * math.cos(alphaInRadians);
  return EVector2D(newX, newY);
}