Beispiel #1
0
 /** Star constructor. */
 public Star(double star_pos_x, double star_pos_y) {
   my_physics = new PhysicsClass();
   // my_animation = new Animation();
   my_physics.mass(STAR_MASS);
   my_physics.position_x(star_pos_x);
   my_physics.position_y(star_pos_y);
 }
Beispiel #2
0
 /** @return What is your velocity in meters per second? */
 public /*@ pure @*/ double[] velocity() {
   return my_physics.velocity();
 }
Beispiel #3
0
 public void simulate(double time) {
   my_physics.simulate(time);
 }
Beispiel #4
0
 // @ ensures \result.length == 2;
 public /*@ pure @*/ double[] position() {
   return my_physics.position();
 }
Beispiel #5
0
 /** @return What is your orientation in radians? */
 public /*@ pure @*/ double orientation() {
   return my_physics.orientation();
 }
Beispiel #6
0
 /** @return What is your momentum in kilograms*meters per second? */
 public /*@ pure @*/ double momentum() {
   return my_physics.momentum();
 }
Beispiel #7
0
  // @ ensures 0 <= \result;
  public /*@ pure @*/ double mass() {

    return my_physics.mass();
  }
Beispiel #8
0
 /** @return What is the gravitational constant? */
 public /*@ pure @*/ double gravitational_constant() {
   return my_physics.gravitational_constant();
 }
Beispiel #9
0
 // @ ensures \result.length == 2;
 public /*@ pure @*/ double[] acceleration() {
   return my_physics.acceleration();
 }