
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
@squawk/flight-math
Advanced tools
Aviation flight computer calculations - the programmatic equivalent of an E6B
Aviation flight computer calculations - the programmatic equivalent of an E6B flight computer. Pure functions for wind triangles, altitude corrections, airspeed conversions, and more.
Part of the @squawk aviation library suite. See all packages on npm.
npm install @squawk/flight-math
All exports are organized by domain namespace, following the same pattern as @squawk/units:
import { atmosphere, airspeed, wind } from '@squawk/flight-math';
// Density altitude from field observations
const da = atmosphere.densityAltitude(5000, 29.92, 35); // field elev, altimeter, OAT
// True altitude corrected for non-standard temperature
const ta = atmosphere.trueAltitude(10000, 29.85, -10);
// CAS from TAS (inverse of isa.trueAirspeedFromCalibratedKt in @squawk/units)
const cas = airspeed.calibratedAirspeedFromTrueAirspeed(250, 20000);
// E6B wind triangle: find heading and groundspeed for a desired course
const wt = wind.solveWindTriangle(150, 270, 310, 25); // TAS, course, wind dir, wind speed
// wt.trueHeadingDeg, wt.windCorrectionAngleDeg, wt.groundSpeedKt
// Headwind and crosswind components for a runway
const hw = wind.headwindCrosswind(310, 15, 280); // wind dir, wind speed, runway heading
// hw.headwindKt, hw.crosswindKt
// Absolute crosswind for limit checking
const xw = wind.crosswindComponent(310, 15, 280);
// Reverse wind triangle: find the wind from observed flight data
const w = wind.findWind(135, 150, 275, 270); // GS, TAS, heading, track
// w.directionDeg, w.speedKt
This package complements @squawk/units, which provides unit conversions, formatting, and the ISA standard atmosphere model. @squawk/flight-math provides higher-level computations that combine multiple inputs (wind triangles, density altitude from field observations, etc.) and uses @squawk/units internally.
Functions that already exist in @squawk/units are not re-exported. Import them directly:
| Calculation | Package |
|---|---|
| Pressure altitude from indicated alt + QNH | @squawk/units (pressure.pressureAltitudeFt) |
| Density altitude from PA + OAT | @squawk/units (isa.densityAltitudeFt) |
| TAS from CAS | @squawk/units (isa.trueAirspeedFromCalibratedKt) |
| Mach from TAS | @squawk/units (isa.machFromTrueAirspeedKt) |
| TAS from Mach | @squawk/units (isa.trueAirspeedFromMachKt) |
| Density altitude from field observations | @squawk/flight-math (atmosphere.densityAltitude) |
| True altitude correction | @squawk/flight-math (atmosphere.trueAltitude) |
| CAS from TAS | @squawk/flight-math (airspeed.calibratedAirspeedFromTrueAirspeed) |
| Wind triangle / components | @squawk/flight-math (wind.*) |
@squawk/unitsFAQs
Aviation flight computer calculations - the programmatic equivalent of an E6B
The npm package @squawk/flight-math receives a total of 35 weekly downloads. As such, @squawk/flight-math popularity was classified as not popular.
We found that @squawk/flight-math demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.