Thunderbots Project
Loading...
Searching...
No Matches
BezierCurve2d Class Reference

#include <bezier_curve2d.h>

Public Member Functions

 BezierCurve2d (std::vector< Point > control_points)
 
const Point getValueAt (double t) const
 
Polynomial2d getPolynomial () const
 
bool operator== (const BezierCurve2d &other) const
 

Detailed Description

A 2D bezier curve, parametrized on [0,1]

A bezier curve is a curve defined by a series of control points, that interpolates the start end point, with the middle points "dragging" the curve to change it's shape.

More info: https://www.ibiblio.org/e-notes/Splines/bezier.html https://en.wikipedia.org/wiki/B%C3%A9zier_curve

Constructor & Destructor Documentation

◆ BezierCurve2d()

BezierCurve2d ( std::vector< Point control_points)
explicit

Construct a bezier curve from the given control points

Parameters
control_pointsThe control points for the bezier curve
Exceptions
std::invalid_argumentIf there are not at least two control points

Member Function Documentation

◆ getPolynomial()

Polynomial2d getPolynomial ( ) const

Get the polynomial representation of this curve

Returns
The polynomial representation of this curve, parametrized such that the value at t=0 is the first control point, and the value at t=1 is the last control point

◆ getValueAt()

const Point getValueAt ( double  t) const

Calculates the value of the curve evaluated at value t

Parameters
tA value in [0,1] to get the value of the curve at. 0 is first control point 1 is last control point
Returns
value of curve evaluated at t. If t is not in [0,1] then the closest endpoint.

◆ operator==()

bool operator== ( const BezierCurve2d other) const

The equality operator for BezierCurve2d

Parameters
otherThe other BezierCurve2d to compare this one to for equality.
Returns
True if this curve is equal to other

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