Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/autonoma.ca.git

Adds emoticon for payload success

Author djarvis <email>
Date 2024-12-17 14:26:56 GMT-0800
Commit 31aa4e9778f7fb28ccf0285d91d7496519aa7a86
Parent 0819c99
calculators/rocket/payload/Rocket.js
const hThrust = thrusting ? Math.sqrt(this.tThrust ** 2 - vThrust ** 2) : 0;
- const g = -this.planet.gravity(this.latitude, this.altitude);
- this.vAcceleration = drag[1] / this.mass + g + vThrust / this.mass;
+ const g = this.planet.gravity(this.latitude, this.altitude);
+ this.vAcceleration = drag[1] / this.mass - g + vThrust / this.mass;
this.hAcceleration = drag[0] / this.mass + hThrust / this.mass;
initialOrbitalVelocity() {
return this.hVelocityInitial;
+ }
+
+ successfulFlight() {
+ return (
+ this.mass >= this.dryMass &&
+ this.hVelocity >= this.hVelocityTarget &&
+ this.altitude >= this.targetAltitude
+ );
}
}
calculators/rocket/payload/calculator.js
blackBox.minMass().toFixed(2)
);
+ $('#payload_delivered').val(
+ this.rocket.successfulFlight() ? "😀 Yes" : "😞 No"
+ );
blackBox.plot();
Delta 13 lines added, 2 lines removed, 11-line increase