![]() |
RaidZeroLib
Coroutine robot framework for VEX V5
|
Cubic Bézier parametric path segment. More...
#include <CubicBezier.hpp>
Classes | |
| class | Knot |
| Control knot defining both position and tangent handle geometry. More... | |
Public Member Functions | |
| CubicBezier (const Knot &start, const Knot &end) noexcept | |
| Constructs a cubic Bézier segment between two control knots. | |
| Point | getPoint (double t) const noexcept override |
| Computes the position P(t) along the cubic Bézier. | |
| Point | getVelocity (double t) const noexcept override |
| Computes the first derivative dP/dt at parameter t. | |
| Point | getAcceleration (double t) const noexcept override |
| Computes the second derivative d²P/dt² at parameter t. | |
| Public Member Functions inherited from rz::ParametricPath | |
| virtual | ~ParametricPath ()=default |
| Virtual destructor. | |
| virtual Angle | getTheta (double t) const noexcept |
| Path heading: orientation of the tangent dP/dt. | |
| virtual Curvature | getCurvature (double t) const noexcept |
| Signed curvature κ(t) = wedge(dP/dt, d²P/dt²) / |dP/dt|³. | |
| virtual Length | getLength (double tStart=0, double tEnd=1) const noexcept |
Arclength along the path between parameters tStart and tEnd. | |
| virtual double | stepT (double t, Length distance) const noexcept |
| Advance the parameter by a target arclength measured along the path. | |
| virtual DiscretePath | toDiscrete (Length distance, bool includeEnd=true) const |
Cubic Bézier parametric path segment.
A CubicBezier represents a smooth parametric curve defined by four control points: P(t) = (1-t)^3 c_0 + 3(1-t)^2 t c_1 + 3(1-t)t^2 c_2 + t^3 c_3.
Each segment is constructed from two knots, which encode both position and tangent direction/length at their endpoints. The constructor expands those into the four cubic control points:
Continuity: When consecutive segments share the same end/start Knot, the resulting chain is automatically C⁰ and C¹ continuous at the join.
Constructs a cubic Bézier segment between two control knots.
The start and end control points define the endpoints and tangents. Internally, the four Bézier control points are expanded as:
| start | Start control knot. |
| end | End control knot. |
|
overridevirtualnoexcept |
Computes the second derivative d²P/dt² at parameter t.
P''(t) = 6(1-t)(c_2 - 2c_1 + c_0) + 6t(c_3 - 2c_2 + c_1)
| t | Normalized parameter ∈ [0, 1]. |
Implements rz::ParametricPath.
|
overridevirtualnoexcept |
Computes the position P(t) along the cubic Bézier.
| t | Normalized parameter ∈ [0, 1]. |
Implements rz::ParametricPath.
|
overridevirtualnoexcept |
Computes the first derivative dP/dt at parameter t.
P'(t) = 3(1-t)^2 (c_1 - c_0) + 6(1-t)t (c_2 - c_1) + 3t^2 (c_3 - c_2)
| t | Normalized parameter ∈ [0, 1]. |
Implements rz::ParametricPath.