|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.cscott.sdr.util.Bezier.Bezier2D
public static class Bezier.Bezier2D
Bundle bezier parameters together into an object
Constructor Summary | |
---|---|
Bezier.Bezier2D(Point... p)
|
Method Summary | |
---|---|
Point |
cp(int i)
Return the specified control point. |
int |
degree()
Return the degree of the Bezier curve, which is one less than the number of control points. |
Point |
evaluate(Fraction t)
Evaluate the given Bezier at the given time parameter, which should be in the range [0, 1]. |
double |
evaluateX(double t)
Evaluate one dimension of the given Bezier in floating point. |
double |
evaluateY(double t)
Evaluate one dimension of the given Bezier in floating point. |
Bezier.Bezier2D |
raise()
Raise the degree of a bezier curve (add an additional control point). |
Bezier.Bezier2D |
tangent()
Compute the derivative of the given Bezier curve. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Bezier.Bezier2D(Point... p)
Method Detail |
---|
public int degree()
public Point cp(int i)
public String toString()
toString
in class Object
public Point evaluate(Fraction t)
public double evaluateX(double t)
public double evaluateY(double t)
public Bezier.Bezier2D tangent()
js> p1 = new Point(Fraction.ZERO, Fraction.ONE); 0,1 js> p2 = new Point(Fraction.ONE, Fraction.ZERO); 1,0 js> b = new Bezier.Bezier2D(p1, p2); [0,1, 1,0] js> b.tangent() [1,-1] js> b.raise() [0,1, 1/2,1/2, 1,0] js> b.raise().tangent() [1,-1, 1,-1]
js> b = new Bezier.Bezier2D(new Point(Fraction.ZERO, Fraction.ZERO), > new Point(Fraction.ZERO, Fraction.ONE), > new Point(Fraction.ONE, Fraction.ONE), > new Point(Fraction.ONE, Fraction.ZERO)); [0,0, 0,1, 1,1, 1,0] js> b.tangent() [0,3, 3,0, 0,-3]
public Bezier.Bezier2D raise()
js> p1 = new Point(Fraction.ZERO, Fraction.ONE); 0,1 js> p2 = new Point(Fraction.ONE, Fraction.ZERO); 1,0 js> b = new Bezier.Bezier2D(p1, p2); [0,1, 1,0] js> b = b.raise() [0,1, 1/2,1/2, 1,0] js> b = b.raise() [0,1, 1/3,2/3, 2/3,1/3, 1,0] js> b = b.raise() [0,1, 1/4,3/4, 1/2,1/2, 3/4,1/4, 1,0]
js> b = new Bezier.Bezier2D(new Point(Fraction.ZERO, Fraction.ZERO), > new Point(Fraction.ZERO, Fraction.ONE), > new Point(Fraction.ONE, Fraction.ONE), > new Point(Fraction.ONE, Fraction.ZERO)); [0,0, 0,1, 1,1, 1,0] js> b = b.raise(); [0,0, 0,3/4, 1/2,1, 1,3/4, 1,0] js> b = b.raise(); [0,0, 0,3/5, 3/10,9/10, 7/10,9/10, 1,3/5, 1,0] js> b = b.raise(); [0,0, 0,1/2, 1/5,4/5, 1/2,9/10, 4/5,4/5, 1,1/2, 1,0] js> b = b.raise(); [0,0, 0,3/7, 1/7,5/7, 13/35,6/7, 22/35,6/7, 6/7,5/7, 1,3/7, 1,0]
|
sdr 0.7 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |