LinearSpline
A spline based on a linear equation. This class implements the Spline interface, providing a way to represent and interpolate along a straight line defined by a LinearEquation.
Methods
LinearSpline(LinearEquation equation)
Constructs a new LinearSpline using the provided LinearEquation.
interpolateY(double x)
Returns the Y-value of the spline at a given X-value, directly using the underlying LinearEquation.
interpolate(double x)
Returns a PointXY object representing the point on the spline at a given X-value.
getStartPoint()
Returns the starting point of the spline. For a linear spline, this is typically the point at X=0 on the equation.
getEndPoint()
Returns the ending point of the spline. For a linear spline, this is typically the point at X=0 on the equation (same as start point as it's an infinite line).
toString()
Returns a string representation of the LinearSpline, including its slope.