xoa.core.spline.compute_cubic_weights_1d#
- xoa.core.spline.compute_cubic_weights_1d(hh, bias, tension)[source]#
Decompose 1-D Hermite cubic interpolation into per-point weights.
The Hermite formula is:
result = h00*p1 + h10*m0 + h01*p2 + h11*m1
where
m0 = compute_tangent(p0, p1, p2, ...)andm1 = compute_tangent(p1, p2, p3, ...).Because
compute_tangentis linear in its point arguments, evaluating it on the three unit-basis vectors(1,0,0),(0,1,0),(0,0,1)gives the scalar coefficient that each point contributes to a tangent:m0 = c0*p0 + c1*p1 + c2*p2 m1 = c0*p1 + c1*p2 + c2*p3
Substituting back yields weights
wsuch thatresult = w[0]*p0 + w[1]*p1 + w[2]*p2 + w[3]*p3.