# cscvn

“Natural” or periodic interpolating cubic spline curve

## Syntax

## Description

returns a parametric variational, or `curve`

= cscvn(`points`

) *natural,* cubic spline
curve (in ppform) passing through the given sequence points
(:*j*), *j* = 1:end. The parameter value
*t*(*j*) for the *j*-th
point follows the Eugene Lee's [1] centripetal scheme, as accumulated square root of chord length:

$$\sum _{i<j}\sqrt{\Vert \text{points}(:,i+1)-\text{points}(:,i)\Vert {}_{2}}$$

If the first and last point coincide and there are no other repeated points) then the function constructs a periodic cubic spline curve. However, double points result in corners.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

`cscvn`

determines the break sequence
`t`

as

$${t}_{k}=\{\begin{array}{l}0,k=1\\ {{\displaystyle \sum _{i=1}^{k-1}\left({\displaystyle \sum _{j=1}^{d}{({p}_{i+1,j}-{p}_{i,j})}^{2}}\right)}}^{\frac{1}{4}},k>1\end{array}$$

where *t _{k}* is the element at position

*k*in

`t`

, 1 ≤ k ≤ n–1, and *p*is the transpose of the

*d*-by-

*n*matrix

`points`

.
If `points`

contains repeated points,
`cscvn`

uses `csape`

with either periodic or
variational end conditions to construct the smooth pieces.
`cscvn`

returns the break sequence `t`

in the `breaks`

field of the `curve`

output
argument.## References

[1] E. T. Y. Lee. “Choosing nodes in parametric curve
interpolation.” *Computer-Aided Design* 21 (1989),
363–370.

## Version History

**Introduced in R2006b**