BezierCurve

public class BezierCurve

This is the BezierCurve class. This class handles the creation of Bezier curves, which are used as the basis of the path for the Path class. Bezier curves are parametric curves defined by a set of control points. So, they take in one input, t, that ranges from [0, 1] and that returns a point on the curve. Essentially, Bezier curves are a way of defining a parametric line easily. You can read more on Bezier curves here: https://en.wikipedia.org/wiki/Bézier_curve

Author

Anyi Lin - 10158 Scott's Bots

Aaron Yang - 10158 Scott's Bots

Harrison Womack - 10158 Scott's Bots

Inheritors

Constructors

Link copied to clipboard
public void BezierCurve()
This creates an empty BezierCurve.
public void BezierCurve(ArrayList<Point> controlPoints)
This creates a new BezierCurve with an ArrayList of control points and generates the curve.
public void BezierCurve(Array<Point> controlPoints)
This creates a new Bezier curve with some specified control points and generates the curve.
public void BezierCurve(Array<Pose> controlPoses)
This creates a new Bezier curve with some specified control points and generates the curve.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
public double approximateLength()
This approximates the length of the BezierCurve in APPROXIMATION_STEPS number of steps.
Link copied to clipboard
public void generateBezierCurve()
This generates the Bezier curve.
Link copied to clipboard
Because, for whatever reason, the second derivative returned by the getSecondDerivative(double t) method doesn't return the correct heading of the second derivative, this gets an approximate second derivative essentially using the limit method.
Link copied to clipboard
Returns the ArrayList of control points for this BezierCurve.
Link copied to clipboard
public double getCurvature(double t)
This returns the curvature of the Bezier curve at a specified t-value.
Link copied to clipboard
This returns a 2D Array of doubles containing the x and y positions of points to draw on FTC Dashboard.
Link copied to clipboard
public Vector getDerivative(double t)
This returns the derivative on the BezierCurve that is specified by the parametric t value.
Link copied to clipboard
This returns the unit tangent Vector at the end of the BezierCurve.
Link copied to clipboard
Returns the first control point for this BezierCurve.
Link copied to clipboard
Returns the last control point for this BezierCurve.
Link copied to clipboard
public Point getPoint(double t)
This returns the point on the Bezier curve that is specified by the parametric t value.
Link copied to clipboard
Returns the second control point, or the one after the start, for this BezierCurve.
Link copied to clipboard
public Vector getSecondDerivative(double t)
This returns the second derivative on the BezierCurve that is specified by the parametric t value.
Link copied to clipboard
Returns the second to last control point for this BezierCurve.
Link copied to clipboard
public void initialize()
This handles most of the initialization of the BezierCurve that is called from the constructor.
Link copied to clipboard
This creates the Array that holds the Points to draw on the Dashboard.
Link copied to clipboard
public double length()
Returns the approximate length of this BezierCurve.
Link copied to clipboard
public String pathType()
Returns the type of path.
Link copied to clipboard
public double UNIT_TO_TIME()
Returns the conversion factor of one unit of distance into t-value.