xoa.core.spline.compute_cubic_weights_1d

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, ...) and m1 = compute_tangent(p1, p2, p3, ...).

Because compute_tangent is 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 w such that result = w[0]*p0 + w[1]*p1 + w[2]*p2 + w[3]*p3.

Parameters:
  • hh (array) – Hermite basis values [h00, h10, h01, h11].

  • bias (float) – Bias parameter.

  • tension (float) – Tension parameter.

Returns:

array – Weights [w0, w1, w2, w3] for the 4 points.