API Reference / chartFeatures · function
Function: chartFeatures()
function chartFeatures(
engine,
jdUt,
opts?): number[];
Encode the sky at an instant as a feature vector: each body's ecliptic longitude becomes a weighted unit-circle point. The deterministic substrate for matching and searching chart configurations — compare two with cosineSimilarity, or rank a time range against one with searchConfigurations.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | Engine | The engine used to evaluate positions. |
jdUt | number | Julian Day in UT. |
opts | FeatureOptions | bodies (ordered; defaults to the ten major bodies), per-body weights, and zodiac (tropical by default). |
Returns
number[]
A flat vector [w·cos(lon), w·sin(lon), ...], two entries per body
in bodies order.
Example
const target = chartFeatures(engine, julianDay(2000, 1, 1));
const now = chartFeatures(engine, julianDay(2025, 6, 1));
cosineSimilarity(now, target); // 1 = identical configuration