API Reference / compileForm · function

Function: compileForm()

function compileForm(constraints, opts?): CompiledForm;

Synthesize a chart form from geometric constraints — the inverse of (time, place) → chart. Given weighted Constraints (aspects, sign placements, exact degrees, declinations, parallels, true 3D separations), find the body positions that best satisfy them via deterministic coordinate descent over (longitude, latitude), and report how well they can be met. When even the best fit is poor, the form is flagged impossible — a valid, informative result.

Parameters

ParameterTypeDescription
constraintsConstraint[]The geometric constraints to satisfy; each may carry a weight (default 1).
optsCompileOptionsrestarts and iters tune the optimizer (more = slower, more thorough); impossibleDeg is the worst-constraint threshold in degrees above which the form is impossible; latBounds widens a body's latitude search range. Defaults: 12, 8, 5.

Returns

CompiledForm

A CompiledForm: solved longitudes and latitudes, total residual, maxConstraintLoss, the impossible flag, and each constraint annotated with its loss.

Example

const form = compileForm([
  { kind: "parallel", a: "venus", b: "jupiter" },     // shared declination
  { kind: "declination", body: "moon", degree: -5 },
  { kind: "aspect", a: "venus", b: "jupiter", angle: 120 },
]);
form.impossible;        // false
form.latitudes.venus;   // the latitude the parallel needed

Start building

Quickstart →