API Reference / constraintLoss · function
Function: constraintLoss()
function constraintLoss(positions, c): number;
Degrees by which a single Constraint is unmet for a set of body
positions — 0 when satisfied. The pure building block of formLoss
and compileForm.
Parameters
| Parameter | Type | Description |
|---|---|---|
positions | Positions | Body positions keyed by id: bare longitudes in degrees (latitude 0), or { lon, lat } states. |
c | Constraint | The constraint to score. |
Returns
number
The unmet amount in degrees (0 = satisfied).