Giving a point on a uniform bspline curve, how to get the tangent vector of this point

422 Views Asked by At

A bspline curve of order $k$ is given by $$C(t) = \sum_{i=0}^n P_i N_{i,k}(t).$$ where $P_i$ are the control points and $N_{i,k}(t)$ a basis function defined on a knot vector $$T = (t_0,t_1,...t_{n+k}).$$ with $$N_{i,1}(t) = \begin{cases}1 & t_i \le t \lt t_{i+1} \\ 0 & \text{otherwise} \end{cases}$$ $$N_{i,k}(t) = \frac{t-t_i}{t_{i+k-1}-t_i}N_{i,k-1}(t)+\frac{t_{i+k}-t}{t_{i+k}-t_{i+1}}N_{i+1,k-1}(t).$$ And it's derivative is $$N_{i,k}' = \frac{k}{t_{i+k}-t_i}N_{i,k-1}(t) + \frac{k}{t_{i+k-1}-t_{i+1}}N_{i+1,k-1}(t) $$

Now with a given t, I can calculate the tangent vector of this given t, but what I want here is that giving a point on the bspline curve, how can I get the tangent vector of this point, or get the t value of this point?

Update:

I have found a way to find the t value of the target point with the Newton iteration method from The Nurbs Book.

The iteration function is: $$ f(t) = C'(t)(C(t) - P)$$ $$ t_{i+1} = t_i - \frac{f(t_i)}{f'(t_i)} = t_i - \frac{C'(t)(C(t)-P)}{C''(t)(C(t)-P) + |C'(t)|^2}$$

The convergence criterion are: $$ |(t_{i+1} - t_i)C'(t_i)| <= \varepsilon_1 $$ $$ |C(t_i) - P| <= \varepsilon_1 $$ $$ |cos<C'(t), (C(t)-P)>| <= \varepsilon_2 $$

I have implemented this method, but sometimes it works well but sometimes it will never converge, because I use the fixed initial $t_0$.

So the problem here is how to find a good initial $t_0$. Anyone can help me about this? Thanks.