movePointByAngle static method

Vector2 movePointByAngle(
  1. Vector2 point,
  2. double speed,
  3. double angle
)

Implementation

static Vector2 movePointByAngle(
  Vector2 point,
  double speed,
  double angle,
) {
  double nextX = speed * cos(angle);
  double nextY = speed * sin(angle);
  return Vector2(point.x + nextX, point.y + nextY);
}