Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/autonoma.ca.git
calculators/rocket/payload/Atmosphere.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
class Layer {
static TEMPERATURES = {
/**
- * See http://www.braeunig.us/space/atmmodel.htm
+ * Responsible for computing temperature, air pressure, and air density at a
+ * given altitude. Based on Robert A. Braeunig's tables and description:
+ *
+ * http://www.braeunig.us/space/atmmodel.htm
*/
class Atmosphere {
calculators/rocket/payload/Earth.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
import Atmosphere from './Atmosphere.js';
+/**
+ * Responsible for computing various planetary attributes of Earth.
+ */
class Earth {
static KELVIN = 273.15;
return Earth.SPEED_SOUND_0C * Math.sqrt((1 + temperature) / Earth.KELVIN);
- }
-
- airPressure(altitude) {
- return this.atmosphere.airPressure(altitude);
}
calculators/rocket/payload/FlightRecorder.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
import Telemetry from './Telemetry.js';
+/**
+ * Responsible for recording flight information at time intervals.
+ */
class FlightRecorder {
constructor() {
calculators/rocket/payload/Rocket.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+/**
+ * Responsible for simulating a rocket flying through a planet's atmosphere
+ * into a stable orbit.
+ */
class Rocket {
/**
/**
- * Simulates the flight of the rocket for a given time step.
+ * Simulates the flight of the rocket for a given time step. Based on
+ * Professor Aaron Ridley's implementation:
*
- * @param {number} step - Time step for the simulation (seconds).
+ * https://github.com/aaronjridley/Kepler/blob/main/OrbitalInsertion/launch.py
+ *
+ * @param {number} step - Time step for the simulation (partial seconds).
*/
fly(step) {
calculators/rocket/payload/Selector.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
/**
- * Provides a syntactic sugar for accessing client-side form fields.
+ * Responsible for simplifying client-side form fields operations.
*/
export function $(selector) {
calculators/rocket/payload/Telemetry.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+/**
+ * Determines the maximum value within an array.
+ */
Array.prototype.max = function () {
let maxVal = this[0];
};
+/**
+ * Determines the minimum value within an array.
+ */
Array.prototype.min = function () {
let minVal = this[0];
};
+/**
+ * Responsible for graphing flight information.
+ */
class Telemetry {
constructor(measureName) {
calculators/rocket/payload/calculator.js
+/* Copyright 2024 White Magic Software, Ltd. -- All rights reserved.
+ *
+ * SPDX-License-Identifier: MIT
+ */
import Earth from './Earth.js';
import FlightRecorder from './FlightRecorder.js';

Adds comments

Author djarvis <email>
Date 2024-12-18 21:01:23 GMT-0800
Commit d9ffc2c0c65157c4229b5471969b16b614647311
Parent 28f83ee
Delta 60 lines added, 8 lines removed, 52-line increase