Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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;
 }