initNonuniformCatmullRom method
dynamic
initNonuniformCatmullRom(
- dynamic x0,
- dynamic x1,
- dynamic x2,
- dynamic x3,
- dynamic dt0,
- dynamic dt1,
- dynamic dt2,
Implementation
initNonuniformCatmullRom(x0, x1, x2, x3, dt0, dt1, dt2) {
// compute tangents when parameterized in [t1,t2]
var t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;
var t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2;
// rescale tangents for parametrization in [0,1]
t1 *= dt1;
t2 *= dt1;
init(x1, x2, t1, t2);
}