Implementations of Pythagorean hodograph (PH) splines in Rust, based on the work of R. Farouki and this paper by Zbyněk Šír & Bert Jüttler.
Pythaogrean hodographs are interpolating polynomial curves that satisfy an analogue of the Pythagorean identity. To illustrate, let
then
There are many useful properties of Pythagorean hodographs as a result of this:
-
The tangent vector,
$\frac{\mathbf{p}'(t)}{|\mathbf{p}'(t)|},$ has rational functions as components. This makes computing the tangent fast, although square roots nowadays have dedicated CPU instructions. -
The arc-length function
$s(t)=\int_0^t|\mathbf{p}'(\tau)|\ d\tau$ is a polynomial function. -
As a corollary of #2, computing the arc-length parameterization is trivial using Newton's method.
-
In three dimensions, Pythagorean hodographs have a naturally associated moving frame called the Euler-Rodrigues frame.
Well-studied readers may have noticed a connection to complex numbers. In particular, if
Complex numbers are isomorphic to the plane, but we need something else if we want to model three dimensions -- quaternions. One has the following presentation:
It then holds that
With spatial PH curves, there is a naturally associated moving frame called the Euler-Rodrigues frame. One has the following formula for the tangent, normal, and binormal:
or, more succinctly, the rotation matrix