aeronautic

Flight

The Flight class, what it holds, and default_flight_input.

import { Flight, default_flight_input } from "@aeronautic/core";

new Flight(input?)

One aircraft's flight. input is a Partial<FlightInput> over default_flight_input().

memberwhat it is
valuesFlightValues: one object for the flight's life, written in place. Read it, don't write it
versioncounts the writes that changed something
airthe MoistAir it flies through, as moist_air gives it
set(input)writes the fields given, keeps the rest. Does nothing when nothing changed. Returns the flight
subscribe(listener)calls listener after each write that changed something. Returns what stops it
track(object, delta_s, options?)works the flight out from how object moved since the last call. Returns the flight
resetTracking()the next track only starts watching

FlightInput

What can be written. Defaults are default_flight_input()'s.

fielddefaultunitmeaning
airspeedMPerS0m/strue airspeed
angleOfAttackRad0radpositive with the nose above the flight path
sideslipRad0radpositive when the air blows from the right
loadFactor1glift over weight
rollRateRadPerS0rad/sright wing down positive
pitchRateRadPerS0rad/snose up positive
yawRateRadPerS0rad/snose right positive
throttle1.10 to 1.10 idle, 1 military power, 1.1 full reheat
roll0−1 to 1the stick, right positive
pitch0−1 to 1the stick, aft positive
yaw0−1 to 1the pedals, right positive
flaps00 to 1fully down at 1
airbrake00 to 1fully out at 1
gear00 to 1down at 1
altitudeM0mabove sea level
temperatureOffsetK0Khow much warmer than the standard day
relativeHumidity0.60 to 1

FlightValues

FlightInput, and what follows from it:

fieldunitmeaning
machairspeed over the speed of sound
dynamicPressurePaPa½ρV²
temperatureKKthe air's, the day's offset included
pressurePaPathe air's static pressure
pressureRatioover sea level's 101 325 Pa
densityKgPerM3kg/m³the moist air's
densityRatioover 1.225 kg/m³, sea level's on a standard day
soundMPerSm/sthe speed of sound
dewPointKKwhere the vapour would condense
ramstagnation over static pressure an inlet recovers, ram_pressure(mach)

FlightTrackOptions

What track takes as its third argument, and <FlightProvider> as props.

optiondefaultmeaning
forward[0, 0, -1]which way the object flies, in its own frame
up[0, 1, 0]which way is its up, in its own frame
position[0, 0, 0]the frame's origin, in the object's frame
seaLevelYnoneworld height of sea level. Left out, the altitude is not tracked
windnonethe wind in world space, m/s
worldUp[0, 1, 0]which way gravity pulls against, in world space

track writes airspeedMPerS, angleOfAttackRad, sideslipRad, loadFactor, the three rates and, with seaLevelY, altitudeM. A first call, a delta_s of zero or less, or one over 0.25 s only starts watching.

On this page