org.openmali.curves
Class BezierCurve2

java.lang.Object
  extended by org.openmali.curves.BezierCurve2

public class BezierCurve2
extends java.lang.Object

A quadric Bezier Curve (degree 2) B(t) = (1-t)^2*P0 + 2*t*(1-t)*P1 + t^2*P2 0 < t < 1

Since:
04 sept. 2007

Constructor Summary
BezierCurve2(Point3f[] points)
           
BezierCurve2(Tuple3f startPoint, Tuple3f midPoint, Tuple3f endPoint)
           
 
Method Summary
 Point3f getBasePoint(int i)
           
 Point3f[] getBasePoints()
           
 Point3f getPoint(float i)
           
<P extends Tuple3f>
P
getPoint(float i, P p)
           
 Point3f[] getPoints(int numPoints)
           
 Point3f[] getPoints(Point3f[] result)
           
 Tuple3f[] getPoints(Tuple3f[] result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BezierCurve2

public BezierCurve2(Tuple3f startPoint,
                    Tuple3f midPoint,
                    Tuple3f endPoint)

BezierCurve2

public BezierCurve2(Point3f[] points)
Method Detail

getBasePoints

public final Point3f[] getBasePoints()
Returns:
the array of base-points for this Bezier Curve.

getBasePoint

public final Point3f getBasePoint(int i)
Returns:
the n-th base-point for this Bezier Curve.

getPoint

public final <P extends Tuple3f> P getPoint(float i,
                                            P p)
Parameters:
i - with 0 < t < 1
p - the point output object to write the calculated point on the Bezier Curve to

getPoint

public final Point3f getPoint(float i)
Parameters:
i - with 0 < t < 1
Returns:
one point on the Bezier curve

getPoints

public final Tuple3f[] getPoints(Tuple3f[] result)
Parameters:
result - result.length Point3fs from the Bezier Curve

getPoints

public final Point3f[] getPoints(Point3f[] result)
Parameters:
result - result.length Point3fs from the Bezier Curve

getPoints

public final Point3f[] getPoints(int numPoints)
Parameters:
numPoints -
Returns:
numPoints * Point3f from the Bezier curve