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

#include <polynomial2d.h>

Public Member Functions

 Polynomial2d ()
 
 Polynomial2d (Polynomial1d poly_x, Polynomial1d poly_y)
 
 Polynomial2d (const std::vector< Point > &points)
 
 Polynomial2d (std::initializer_list< Point > points)
 
Point getValueAt (double val) const
 
const Polynomial1dgetPolyX () const
 
const Polynomial1dgetPolyY () const
 

Detailed Description

A 2D polynomial, represented as two polynomials, x(t) and y(t)

Constructor & Destructor Documentation

◆ Polynomial2d() [1/4]

Construct a 2D polynomial. This will construct the polynomial such that it always returns the point (0,0).

◆ Polynomial2d() [2/4]

Polynomial2d ( Polynomial1d  poly_x,
Polynomial1d  poly_y 
)

Construct a 2d polynomial from two underlying 1d polynomials

Note that these polynomials do not necessarily need to be of the same order.

Parameters
poly_xx(t), defines the x-coordinate of this 2D polynomial
poly_yy(t), defines the y-coordinate of this 2D polynomial

◆ Polynomial2d() [3/4]

Polynomial2d ( const std::vector< Point > &  points)
explicit

Construct a 2d polynomial that passes through the given points

The created polynomial will be at the first point at t=0, and at the last point at t=1, with the other points linearly interpolated in-between; ie. if we had three points, the second point would be at t=0.5

Parameters
pointsA series of points the created polynomial will pass through. There must be at least two points.
Exceptions
std::invalid_argumentIf there are less then two points

◆ Polynomial2d() [4/4]

Polynomial2d ( std::initializer_list< Point points)

Construct a 2d polynomial that passes through the given points

The created polynomial will be at the first point at t=0, and at the last point at t=1, with the other points linearly interpolated in-between; ie. if we had three points, the second point would be at t=0.5

Parameters
pointsA series of points the created polynomial will pass through. There must be at least two points.
Exceptions
std::invalid_argumentIf there are less then two points

Member Function Documentation

◆ getPolyX()

const Polynomial1d & getPolyX ( ) const

Get the polynomial x(t) underlying this 2d Polynomial

Returns
The polynomial x(t) underlying this 2d Polynomial

◆ getPolyY()

const Polynomial1d & getPolyY ( ) const

Get the polynomial y(t) underlying this 2d Polynomial

Returns
The polynomial y(t) underlying this 2d Polynomial

◆ getValueAt()

Point getValueAt ( double  val) const

Calculates the value of polynomial evaluated at value val

Parameters
valvalue to evaluate polynomial
Returns
value of polynomial evaluated at value val

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