BezierUtil All credits go to Alex Ulhmann and its Animation Package Library
static public function getPointsOnQuadCurve(p:Number, p1:Vector, p2:Vector, p3:Vector):Vector
p | (Number) A percentage between [0-1] |
p1 | (Vector) |
p2 | (Vector) |
p3 | (Vector) |
Vector The resulting position vector
static public function getPointsOnCubicCurve(p:Number, p1:Vector, p2:Vector, p3:Vector, p4:Vector):Vector
p | (Number) A percentage between [0-1] |
p1 | (Vector) |
p2 | (Vector) |
p3 | (Vector) |
p4 | (Vector) |
Vector The resulting position vector
static public function getQuadControlPoints(start:Vector, middle:Vector, end:Vector):Vector
start | Vector The starting point |
middle | Vector The point where the curve goes throught |
end | Vector The end point of the curve |
Vector The control point
static public function getCubicControlPoints(start:Vector, through1:Vector, through2:Vector, end:Vector):Array
start | (Vector) |
through1 | (Vector) |
through2 | (Vector) |
end | (Vector) |
Array of Vector. A two dimensionnal array containing the two controls points.
static public function casteljau(p:Number, plist:Array):VectorApply the casteljau algorithm.
p | Number A percentage value between [0-1] |
plist | Array of Vector The list of vector that are used as control points of the Bezier curve. |
Vector The position on the Bezier curve at the ration p of the curve.
static public function casteljau_interval(p:Number, plist:Array, pdeb:Number, pfin:Number):VectorMore robust casteljau algorithm if the intervals are wierd. UNTESTED METHOD. MAY BE REMOVED IN THE FUTURE VERSION. USE IT CAREFULLY.
p | |
plist | |
pdeb | |
pfin |