Skip to content

Main content

Interpolation: Piecewise Knot Side Selection Tool

Select a piecewise interval at one sorted distinct knot grid with explicit left/right interior-knot tie convention; exterior points return index -1.

Loading tool…

Description

Select the interval using tieSide at an interior knot, retain the first or last interval at domain endpoints, and return -1 outside.

Interpolation knots divide a coordinate range into intervals. Repeated nodes, unequal spacing, and exact boundary selection can change how a piecewise interpolant is interpreted.

Select the interval using tieSide at an interior knot, retain the first or last interval at domain endpoints, and return -1 outside.

When to use this tool

Use Interpolation: Piecewise Knot Side Selection when you need one knot-interval or multiplicity diagnostic.

How to use the tool and how it works

  1. Enter knots, x, tieSide. 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.

Require at least two strictly increasing knots. Select the interval using tieSide at an interior knot, retain the first or last interval at domain endpoints, and return -1 outside.1

Input fieldMeaning and unitsAccepted input
knotsKnotsRequired. Array of finite number. Implementation limit: 128 items.
xXRequired. Finite number.
tieSideTie SideRequired. Text; one of "left", "right". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.intervalIndexInterval IndexCalculated result member: number.
result.outsideOutsideCalculated result member: boolean.
json
{
  "input": {
    "knots": [
      0,
      1,
      2
    ],
    "x": 1,
    "tieSide": "right"
  },
  "output": {
    "result": {
      "intervalIndex": 1,
      "outside": false
    }
  }
}

Limitations and assumptions

  • Outside is a diagnostic flag and no extrapolation interval is assigned; exact knot equality uses no tolerance.
  • 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

Validate the complete knot sequence and interpolation method, including tolerance and extrapolation policies.

References

  1. Calculation and input contract: interpolation/piecewise-knot-side-selection — tool.io

Similar or alternative tools