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
| Parameter | Type | Description |
|---|---|---|
lons | Record<string, number> | Body longitudes in degrees, keyed by body id. |
c | Constraint | The constraint to score. |
Returns
number
The unmet amount in degrees (0 = satisfied).