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 between bodies, sign placements, exact degrees), find the body longitudes that best satisfy them via deterministic coordinate descent, 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. Defaults: 12, 8, 5.

Returns

CompiledForm

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

Example

const form = compileForm([
  { kind: "aspect", a: "sun", b: "moon", angle: 120 }, // trine
  { kind: "sign", body: "sun", sign: 0 },              // Aries
]);
form.impossible;     // false
form.longitudes.sun; // a degree within Aries

Start building

Quickstart →