|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.graphbuilder.curve.Curve
com.graphbuilder.curve.ParametricCurve
com.graphbuilder.curve.BezierCurve
General n-point Bezier curve implementation. The Bezier curve defines itself using all the points from the control-path specified by the group-iterator. To compute a single point on the curve requires O(n) multiplications where n is the group-size of the group-iterator. Thus, the Bezier curve is considered to be expensive, but it has several mathematical properties (not discussed here) that make it appealing. Figure 1 shows an example of a Bezier curve.
The maximum number of points that the Bezier curve can use is 1030 because the evaluation of a point uses the nCr (n-choose-r) function. The computation uses double precision, and double precision cannot represent the result of 1031 choose i, where i = [500, 530].
Curve
,
PascalsTriangle
Field Summary |
Fields inherited from class com.graphbuilder.curve.Curve |
connect, cp, gi |
Constructor Summary | |
BezierCurve(ControlPath cp,
GroupIterator gi)
|
Method Summary | |
void |
appendTo(MultiPath mp)
The only requirement for this curve is the group-iterator must be in range or this method returns quietly. |
void |
eval(double[] p)
The eval method evaluates a point on a curve given a parametric value "t". |
int |
getSampleLimit()
The sample limit specifies how many additional subdivisions are done to ensure that there are no missed pieces of the curve. |
void |
resetMemory()
Resets the shared memory to the initial state. |
void |
setInterval(double t_min,
double t_max)
Specifies the interval that the curve should define itself on. |
void |
setSampleLimit(int limit)
Sets the sample-limit. |
double |
t_max()
Returns the finishing interval value. |
double |
t_min()
Returns the starting interval value. |
Methods inherited from class com.graphbuilder.curve.Curve |
getConnect, getControlPath, getGroupIterator, setConnect, setControlPath, setGroupIterator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BezierCurve(ControlPath cp, GroupIterator gi)
Method Detail |
public void eval(double[] p)
ParametricCurve
eval
in class ParametricCurve
public int getSampleLimit()
ParametricCurve
getSampleLimit
in class ParametricCurve
public void setSampleLimit(int limit)
java.lang.IllegalArgumentException
- If sample-limit < 0.BinaryCurveApproximationAlgorithm
,
getSampleLimit()
public void setInterval(double t_min, double t_max)
java.lang.IllegalArgumentException
- If t_min > t_max.t_min()
,
t_max()
public double t_min()
setInterval(double, double)
,
t_max()
public double t_max()
setInterval(double, double)
,
t_min()
public void appendTo(MultiPath mp)
appendTo
in class Curve
MultiPath
,
BinaryCurveApproximationAlgorithm
public void resetMemory()
Curve
resetMemory
in class Curve
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |