File-By-File
ZeroSlopeSpline

ZeroSlopeSpline

The ZeroSlopeSpline class represents a spline with a constant Y-value, effectively having a slope of zero. This is useful for scenarios where a flat, horizontal trajectory or interpolation is required.

Constructor

  • ZeroSlopeSpline(double returnValue): Creates a new ZeroSlopeSpline instance. The returnValue parameter defines the constant Y-value that the spline will always return.

Instance Methods

  • interpolateY(double x): Returns the constant returnValue regardless of the input x value. This method fulfills the Spline interface contract for Y-interpolation.
  • interpolate(double x): Returns a PointXY object where the X-coordinate is the input x and the Y-coordinate is the constant returnValue. This method fulfills the Spline interface contract for point interpolation.
  • getStartPoint(): Returns a PointXY representing the conceptual start point of the spline. For a ZeroSlopeSpline, this is (0, returnValue).
  • getEndPoint(): Returns a PointXY representing the conceptual end point of the spline. For a ZeroSlopeSpline, this is (0, returnValue).