1
$\begingroup$

From Wikipedia, we have a few variations for calculating tangents when creating a spline based only on positions of control-points:

Finite difference

$$\mathbf m_k=\frac{\mathbf p_{k+1}-\mathbf p_k}{2(t_{k+1}-t_k)}+\frac{\mathbf p_k-\mathbf p_{k-1}}{2(t_k-t_{k-1})}$$

Cardinal

$$\mathbf m_k=(1-c)\frac{\mathbf p_{k+1}-\mathbf p_{k-1}}{t_{k+1}-t_{k-1}}$$

Catmull–Rom

$$\mathbf m_k=\frac{\mathbf p_{k+1}-\mathbf p_{k-1}}{t_{k+1}-t_{k-1}}$$

In all cases, $\mathbf m_k$ is the tangent vector to control point $\mathbf p_k$ and $t_k$ is the parameter value $0 \leq t \leq 1$ for $\mathbf p_k$ on the spline.


The problem I have is, this method requires knowing $t_k$ to find $\mathbf m_k$. But you can't calculate $t_k$ until you know the lengths of each section of the spline, which in turn relies on knowing the tangent vectors.

Am I misunderstanding something basic, or does this chicken-and-egg situation really exist?

  • 1
    Usually, one uses things like centripetal or chord-length parametrization to generate suitable parameter values $t_k$ corresponding to your (two or three-dimensional) points $\mathbf p_k$.2012-02-02
  • 0
    @J.M. OK so it is a 'real' problem requiring some approximation... I've taken the simple approach of using straight-line length between $\mathbf p_k$ & $\mathbf p_{k+1}$. If you want the points, submit your comment as an answer.2012-02-03

1 Answers 1