public static int computeDeltaY(int y, int speed, int angle) { double rad = Math.PI / 180.0 * angle; int ny = (int) (Math.sin(rad) * speed) + y; return ny; }
public static int computeDeltaX(int x, int speed, int angle) { double rad = Math.PI / 180.0 * angle; int nx = (int) (Math.cos(rad) * speed) + x; return nx; }