title: Kochanek–Bartels spline
text: # Kochanek–Bartels spline
  
  In mathematics, a Kochanek–Bartels spline or Kochanek–Bartels curve is a cubic Hermite spline with tension, bias, and continuity parameters defined to change the behavior of the tangents.
  
  Given n + 1 knots,
  
      $p_0,$ ..., $p_n,$
  
  to be interpolated with n cubic Hermite curve segments, for each curve we have a starting point $p_i$ and an ending point $p_{i+1}$ with starting tangent $d_i$ and ending tangent $d_{i+1}$ defined by
  
      $\mathbf {d} _{i}={\frac {(1-t)(1+b)(1+c)}{2}}(\mathbf {p} _{i}-\mathbf {p} _{i-1})+{\frac {(1-t)(1-b)(1-c)}{2}}(\mathbf {p} _{i+1}-\mathbf {p} _{i})$
      $\mathbf {d} _{i+1}={\frac {(1-t)(1+b)(1-c)}{2}}(\mathbf {p} _{i+1}-\mathbf {p} _{i})+{\frac {(1-t)(1-b)(1+c)}{2}}(\mathbf {p} _{i+2}-\mathbf {p} _{i+1})$
  
  where...
  
  | t | tension | Changes the length of the tangent vector |
  | - | - | - |
  | b | bias | Primarily changes the direction of the tangent vector |
  | c | continuity | Changes the sharpness in change between tangents |
  
  Setting each parameter to zero would give a Catmull–Rom spline.
  
  The source code found here of Steve Noskowicz in 1996 actually describes the impact that each of these values has on the drawn curve:
  
  | Tension | T = +1→ Tight | T = −1→ Round |
  | - | - | - |
  | Bias | B = +1→ Post Shoot | B = −1→ Pre shoot |
  | Continuity | C = +1→ Inverted corners | C = −1→ Box corners |
  
  The code includes matrix summary needed to generate these splines in a BASIC dialect.
  
  