RaidZeroLib
Coroutine robot framework for VEX V5
Loading...
Searching...
No Matches
CubicBezier.hpp
1#pragma once
2#include "RaidZeroLib/api/Geometry/Point.hpp"
3#include "RaidZeroLib/api/Pathing/ParametricPath.hpp"
4
5namespace rz {
6
27 public:
41 class Knot {
42 public:
53 Knot(Length x, Length y, Angle theta, Length magnitude) noexcept;
54
56 Point getPoint() const noexcept;
57
59 Point getForwardControl() const noexcept;
60
62 Point getBackwardControl() const noexcept;
63
64 private:
65 Length x;
66 Length y;
67 Angle theta;
68 Length magnitude;
69 };
70
86 CubicBezier(const Knot& start, const Knot& end) noexcept;
87
94 Point getPoint(double t) const noexcept override;
95
104 Point getVelocity(double t) const noexcept override;
105
114 Point getAcceleration(double t) const noexcept override;
115
116 private:
117 Point c0;
118 Point c1;
119 Point c2;
120 Point c3;
121};
122
123} // namespace rz
Control knot defining both position and tangent handle geometry.
Definition CubicBezier.hpp:41
Point getPoint() const noexcept
Returns the anchor position (x, y) of the control knot.
Point getForwardControl() const noexcept
Returns the forward (outgoing) control handle in world coordinates.
Point getBackwardControl() const noexcept
Returns the backward (incoming) control handle in world coordinates.
Knot(Length x, Length y, Angle theta, Length magnitude) noexcept
Constructs a control knot with position, tangent angle, and handle length.
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.
Differentiable 2D path over a unit-interval parameter t ∈ [0, 1].
Definition ParametricPath.hpp:26
Immutable 2D point / vector with unit-safe Cartesian coordinates.
Definition Point.hpp:21
void start(RobotConfig config)
Starts RaidZeroLib on the brain. Call once from initialize().
au::QuantityD< au::Radians > Angle
Definition Units.hpp:13
au::QuantityD< au::Meters > Length
Definition Units.hpp:9
Definition DriverControl.hpp:11