API Reference / constraintLoss · function

Function: constraintLoss()

function constraintLoss(lons, c): number;

Degrees by which a single Constraint is unmet for a set of body longitudes — 0 when satisfied. The pure building block of formLoss and compileForm.

Parameters

ParameterTypeDescription
lonsRecord<string, number>Body longitudes in degrees, keyed by body id.
cConstraintThe constraint to score.

Returns

number

The unmet amount in degrees (0 = satisfied).

Start building

Quickstart →