Exemplo n.º 1
0
 public Body(double mass, double x, double y, double velocity, double direciton)
 {
     this.mass = mass;
     this.position = new Position(x,y);
     this.motion = new Motion(velocity,direciton);
 }
Exemplo n.º 2
0
 public static void move(Position position, Motion motion)
 {
     // Calcluate the new position given the motion.
     // Update the position.
     double rad = motion.getDirection() * Math.PI / 180.0;
     double dx = motion.getVelocity() * Math.Cos(rad);
     double dy = motion.getVelocity() * Math.Sin(rad) * -1.0;
     position.setX(position.getX() + dx);
     position.setY(position.getY() + dy);
 }
Exemplo n.º 3
0
 public Beam(double x, double y, double velocity, double direciton)
 {
     this.position = new Position(x,y);
     this.motion = new Motion(velocity,direciton);
 }