Thunderbots Project
Loading...
Searching...
No Matches
Spline2d Class Referenceabstract

#include <spline2d.h>

Inheritance diagram for Spline2d:

Public Member Functions

virtual const Point getValueAt (double t) const =0
 
virtual const std::vector< PointgetKnots () const =0
 
virtual size_t getNumKnots () const =0
 
virtual std::vector< double > getKnotParametrizationValues () const =0
 
virtual const Point getStartPoint () const =0
 
virtual const Point getEndPoint () const =0
 
virtual const std::vector< SplineSegment2dgetSplineSegments () const =0
 

Static Protected Member Functions

static SplineSegment2d createSplineSegment2d (double start_val, double end_val, Polynomial2d polynomial)
 

Detailed Description

A 2D spline, consistent of a series of connected 2D polynomials.

Important terms: "knot" - A point on the spline where two consecutive polynomials meet

Member Function Documentation

◆ createSplineSegment2d()

SplineSegment2d createSplineSegment2d ( double  start_val,
double  end_val,
Polynomial2d  polynomial 
)
staticprotected

Create a SplineSegment2d

The reason that this function exists is because friendship is not inherited, and we do not want to publicly expose the constructor for SplineSegment2d. So we allow subclasses to create segments via this function.

Parameters
start_valThe first value at which to evaluate the polynomial that lies on the spline
end_valThe last value at which to evaluate the polynomial that lies on the spline
polynomialThe polynomial, part of which is on the spline
Returns
A SplineSegment2d created from the given parameters

◆ getEndPoint()

virtual const Point getEndPoint ( ) const
pure virtual

Gets end point of spline

Returns
end point of spline

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getKnotParametrizationValues()

virtual std::vector< double > getKnotParametrizationValues ( ) const
pure virtual

Get the parametrization values corresponding to the knots of this spline

So for example, if we had a 3-knot spline that is linearly interpolated, this function would return {0, 0.5, 1}.

NOTE: There is no guarantee that the knots will be at linearly interpolated (equally spaced) intervals. This could return {0, 0.25, 1.0} and still be well defined.

Returns
The parametrization values corresponding to the knots of this spline

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getKnots()

virtual const std::vector< Point > getKnots ( ) const
pure virtual

Get the knots of this spline, including the start and end points

Returns
The knots of this spline, including the start and end points

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getNumKnots()

virtual size_t getNumKnots ( ) const
pure virtual

Gets the number of knots in the spline including start and end points

Returns
The number of knots in the spline including start and end points

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getSplineSegments()

virtual const std::vector< SplineSegment2d > getSplineSegments ( ) const
pure virtual

Get the segments that make up this spline.

Returns
The segments that make up this spline, with the order of segments being the order in which they appear along the spline, going from start to end.

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getStartPoint()

virtual const Point getStartPoint ( ) const
pure virtual

Gets start point of spline

Returns
start point of spline

Implemented in CubicBezierSpline2d, and LinearSpline2d.

◆ getValueAt()

virtual const Point getValueAt ( double  t) const
pure virtual

Calculates the value of spline evaluated at value t

Parameters
tA value in [0,1] to get the value of the spline at. 0 is one endpoint of the spline 1 is the other endpoint of the spline
Returns
Value of spline evaluated at t. If t not in [0,1], then the closest endpoint

Implemented in CubicBezierSpline2d, and LinearSpline2d.


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