Skip to content

Main content

Interpolation: Monotone Endpoint Slope Clamp Tool

Apply a local monotone endpoint slope limiter: zero opposite-sign candidates and cap magnitude at three times the adjacent secant; not a full monotone spline fit.

Loading tool…

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

  1. Enter candidateSlope, adjacentSecant. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
candidateSlopeCandidate SlopeRequired. Finite number.
adjacentSecantAdjacent SecantRequired. Finite number.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.clampedSlopeClamped SlopeCalculated result member: number.
json
{
  "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

  1. Calculation and input contract: interpolation/monotone-endpoint-slope-clamp — tool.io

Similar or alternative tools