/** 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); }
/** @return What is your velocity in meters per second? */ public /*@ pure @*/ double[] velocity() { return my_physics.velocity(); }
public void simulate(double time) { my_physics.simulate(time); }
// @ ensures \result.length == 2; public /*@ pure @*/ double[] position() { return my_physics.position(); }
/** @return What is your orientation in radians? */ public /*@ pure @*/ double orientation() { return my_physics.orientation(); }
/** @return What is your momentum in kilograms*meters per second? */ public /*@ pure @*/ double momentum() { return my_physics.momentum(); }
// @ ensures 0 <= \result; public /*@ pure @*/ double mass() { return my_physics.mass(); }
/** @return What is the gravitational constant? */ public /*@ pure @*/ double gravitational_constant() { return my_physics.gravitational_constant(); }
// @ ensures \result.length == 2; public /*@ pure @*/ double[] acceleration() { return my_physics.acceleration(); }