| | |
| | class Simulation { |
| | - constructor() { |
| | - this.rocket = new Rocket(); |
| | - } |
| | + constructor() {} |
| | |
| | - inputs() { |
| | + init() { |
| | const initialVelocity = $('#initial_velocity').val(); |
| | const initialLatitude = $('#initial_latitude').val(); |
 |
| | this.planet = new Earth(initialLatitude); |
| | this.rocket = new Rocket(wetMass, payloadMass); |
| | + |
| | this.rocket.on(this.planet); |
| | this.rocket.fuselage(rocketDiameter, dragCoefficient, specificImpulse); |
 |
| | |
| | simulate() { |
| | - this.inputs(); |
| | + this.init(); |
| | this.run(); |
| | } |
| | } |
| | |
| | -// Initialize simulation |
| | const simulation = new Simulation(); |
| | |