All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphbuilder.curve.ParametricCurve Maven / Gradle / Ivy

Go to download

Implementation of various mathematical curves that define themselves over a set of control points. The API is written in Java. The curves supported are: Bezier, B-Spline, Cardinal Spline, Catmull-Rom Spline, Lagrange, Natural Cubic Spline, and NURBS.

There is a newer version: 1.08
Show newest version
package com.graphbuilder.curve;

/**
Curves that extend the ParametricCurve class are continuous and can use the
BinaryCurveApproximationAlgorithm class to generate a sequence of points that
approximate the curve.  Note: Approximate means a finite set of points that
are on the curve, not close to the curve.

@see com.graphbuilder.curve.BinaryCurveApproximationAlgorithm
@see com.graphbuilder.curve.Curve
*/
public abstract class ParametricCurve extends Curve {

	public ParametricCurve(ControlPath cp, GroupIterator gp) {
		super(cp, gp);
	}

	/**
	The eval method evaluates a point on a curve given a parametric value "t".  The parametric
	value "t" is stored in the last index location of the specified double array.  This value
	should not be changed.  The dimension of the point to evaluate is p.length - 1.  The result
	of the evaluation is placed in index locations 0 .. p.length - 2 (inclusive).

	The eval method should remain protected except for those curves that do no need any
	preparation to be done in the appendTo method.
	*/
	protected abstract void eval(double[] p);

	/**
	The sample limit specifies how many additional subdivisions are done to ensure that there
	are no missed pieces of the curve.  The sample limit must be >= 0.
	*/
	public abstract int getSampleLimit();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy