MCPcopy Create free account
hub / github.com/andrewwillmott/splines-lib / TriSign

Function TriSign

Splines.cpp:217–225  ·  view source on GitHub ↗

Monotone Piecewise Cubic Interpolation

Source from the content-addressed store, hash-verified

215
216 // Monotone Piecewise Cubic Interpolation
217 inline int TriSign(float x, float eps = 1e-6f)
218 {
219 if (x < -eps)
220 return -1;
221 if (x > +eps)
222 return +1;
223
224 return 0;
225 }
226
227 // Given dv = Bezier delta from corresponding adjacent endpoint, and the
228 // corresponding end and hull values, return a clamped version of dv that avoids overshoots

Callers 1

CubicMonoDeltaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected