Description
Return zero when adjacentSecant is zero or candidateSlope has a nonpositive product with it.
Shape-preserving interpolation constrains local derivatives to avoid unwanted overshoot. One endpoint clamp can enforce a local sign and magnitude condition without proving a whole curve monotone.
Return zero when adjacentSecant is zero or candidateSlope has a nonpositive product with it.
When to use this tool
Use Interpolation: Monotone Endpoint Slope Clamp when you need one explicit slope-clamp component.
How to use the tool and how it works
- Enter candidateSlope, adjacentSecant. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Return zero when adjacentSecant is zero or candidateSlope has a nonpositive product with it. Otherwise retain the secant sign and cap slope magnitude at three times abs(adjacentSecant).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| candidateSlope | Candidate Slope | Required. Finite number. |
| adjacentSecant | Adjacent Secant | Required. Finite number. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.clampedSlope | Clamped Slope | Calculated result member: number. |
{
"input": {
"candidateSlope": 5,
"adjacentSecant": 1
},
"output": {
"result": {
"clampedSlope": 3
}
}
} Limitations and assumptions
- This is one supplied endpoint clamp, not a full monotone cubic interpolation method or global shape guarantee.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use a complete monotone interpolation method and inspect all adjoining intervals for a global shape guarantee.
References
Similar or alternative tools
- Monotone Linear Segment Direction
Require leftX < rightX and return sign(rightY - leftY) as direction plus an exact flat flag.
- Hermite Endpoint Slope Residual
Select the requested endpoint tangent and divide by x1 - x0 only when tangentsAreParameterDerivatives; subtract suppliedSlope for residual.