Пример #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);
 }
Пример #2
0
 /** @return What is your velocity in meters per second? */
 public /*@ pure @*/ double[] velocity() {
   return my_physics.velocity();
 }
Пример #3
0
 public void simulate(double time) {
   my_physics.simulate(time);
 }
Пример #4
0
 // @ ensures \result.length == 2;
 public /*@ pure @*/ double[] position() {
   return my_physics.position();
 }
Пример #5
0
 /** @return What is your orientation in radians? */
 public /*@ pure @*/ double orientation() {
   return my_physics.orientation();
 }
Пример #6
0
 /** @return What is your momentum in kilograms*meters per second? */
 public /*@ pure @*/ double momentum() {
   return my_physics.momentum();
 }
Пример #7
0
  // @ ensures 0 <= \result;
  public /*@ pure @*/ double mass() {

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