API Reference / Turbo · class
Class: Turbo
Runtime evaluator for a turbo pack — a segmented Chebyshev fit of the engine's apparent longitude over a fixed range and body set. Evaluating a longitude costs a couple dozen multiply-adds, so a century-scale transit scan that calls it tens of thousands of times runs in milliseconds. Construct one from a pack you minted offline; it does no fitting, no I/O, and needs no Engine.
Example
const turbo = new Turbo(pack); // a TurboPack generated for your range/bodies
if (turbo.has("mars")) turbo.longitude("mars", jd);
Constructors
Constructor
new Turbo(pack): Turbo;
Parameters
| Parameter | Type | Description |
|---|---|---|
pack | TurboPack | A TurboPack: the fitted segments plus its jd0/jd1 range, minted offline for your bodies and span. |
Returns
Turbo
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
<a id="jd0"></a> jd0 | readonly | number | Start of the pack's valid Julian Day (UT) range. |
<a id="jd1"></a> jd1 | readonly | number | End of the pack's valid Julian Day (UT) range. |
Methods
has()
has(body): boolean;
Whether this pack can evaluate a given body.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | string | Body id to test. |
Returns
boolean
true if Turbo.longitude accepts body.
longitude()
longitude(body, jd): number;
Apparent ecliptic longitude (degrees) of a body from the turbo pack, in the pack's own zodiac. The hot path for bulk scans.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | string | A body id the pack contains (see Turbo.has). |
jd | number | Julian Day (UT), within [jd0, jd1]. |
Returns
number
Ecliptic longitude in degrees, [0, 360).
Throws
Error if the pack lacks body, or jd is outside [jd0, jd1].