geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
BezierSpline< T, N > Class Template Reference

A cubic spline with two knots and two tangent points. More...

#include <geomc/shape/CubicSpline.h>

Inheritance diagram for BezierSpline< T, N >:
CubicSpline< T, N, BezierSpline< T, N > > Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 

Public Member Functions

constexpr BezierSpline (const VecType< T, N > pts[4])
 Construct the spline from an array of control points.
 
constexpr BezierSpline (VecType< T, N > p0, VecType< T, N > t0, VecType< T, N > t1, VecType< T, N > p1)
 Construct the spline from four control points.
 
constexpr Vec< T, Nacceleration (T s) const
 Compute the second derivative (acceleration) of the spline at a given parameter value.
 
constexpr Rect< T, Nbounds () const
 Compute the bounding box of the spline.
 
constexpr VecType< T, N > * control_points ()
 Get the control points.
 
constexpr const VecType< T, N > * control_points () const
 Get the control points.
 
constexpr operator PolynomialSpline< T, N > () const
 Convert this spline to its coefficient representation.
 
constexpr operator Spline () const
 Convert to another type of cubic spline.
 
constexpr Vec< T, Noperator() (T s) const
 Evaluate the spline at a given parameter value.
 
constexpr Vec< T, Nvelocity (T s) const
 Compute the derivative (velocity) of the spline at a given parameter value.
 

Static Public Member Functions

static constexpr SimpleMatrix< T, 4, 4 > basis ()
 Get the basis matrix, which converts control points to coefficients.
 
static constexpr SimpleMatrix< T, 4, 4 > inverse_basis ()
 Get the inverse basis matrix, which converts coefficients to control points.
 

Public Attributes

VecType< T, Np0
 Position at s = 0.
 
VecType< T, Np1
 Position at s = 1.
 
VecType< T, Nt0
 Tangent point for s = 0.
 
VecType< T, Nt1
 Tangent point for s = 1.
 

Static Public Attributes

static constexpr SimpleMatrix< T, 4, 4 > CoefficientsToControl
 
static constexpr SimpleMatrix< T, 4, 4 > ControlToCoefficients
 
static constexpr index_t N
 The dimension of this object.
 

Related Symbols

(Note that these are not member symbols.)

template<typename T, index_t N, Transform< T, N > Xf>
BezierSpline< T, Noperator* (const Xf &xf, const BezierSpline< T, N > &spline)
 
template<typename T, index_t N, Transform< T, N > Xf>
BezierSpline< T, Noperator/ (const BezierSpline< T, N > &spline, const Xf &xf)
 

Detailed Description

template<typename T, index_t N>
class geom::BezierSpline< T, N >

A cubic spline with two knots and two tangent points.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Member Data Documentation

◆ CoefficientsToControl

template<typename T, index_t N>
SimpleMatrix<T,4,4> CoefficientsToControl
staticconstexpr
Initial value:
= {
{3, 0, 0, 0},
{3, 1, 0, 0},
{3, 2, 1, 0},
{3, 3, 3, 3},
}

◆ ControlToCoefficients

template<typename T, index_t N>
SimpleMatrix<T,4,4> ControlToCoefficients
staticconstexpr
Initial value:
= {
{ 1, 0, 0, 0},
{-3, 3, 0, 0},
{ 3, -6, 3, 0},
{-1, 3, -3, 1},
}

The documentation for this class was generated from the following file: