#include <bezier_curve2d.h>
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
◆ BezierCurve2d()
Construct a bezier curve from the given control points
- Parameters
-
| control_points | The control points for the bezier curve |
- Exceptions
-
| std::invalid_argument | If there are not at least two control points |
◆ getPolynomial()
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
-
| t | A 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==()
The equality operator for BezierCurve2d
- Parameters
-
| other | The 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: