Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Particle setShip() {
- double diffX = earth.x - sun.x;
- double diffY = earth.y - sun.y;
- double angle = Math.atan2(diffY, diffX) + Math.toRadians(ship_launchAngle);
- double shipRad = 50;
- double x = earth.x + ((earth.radius + shipRad + ship_height) * Math.cos(angle));
- double y = earth.y + ((earth.radius + shipRad + ship_height) * Math.sin(angle));
- double vel = (ship_vo);
- double Vx = earth.velX + vel * Math.cos((Math.PI / 2) + angle);
- double Vy = earth.velY + vel * Math.sin((Math.PI / 2) + angle);
- return new Particle(x, y, Vx, Vy, ship_radius, ship_mass);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement