I've got this little function hidden away in my maths module:

`Function Bezier:Float(p1:Float, p2:Float, cp1:Float, cp2:Float, t:Float)`

Local v:Float = p1 * Pow( (1 - t), 3) + 3 * cp1 * Pow( (1 - t), 2) * t + 3 * cp2 * (1 - t) * Pow(t, 2) + p2 * Pow(t, 3)

Return v

EndFunction

and

`Function BezierCurve(sx:Float,sy:Float,ex:Float,ey:Float,p1x:Float,p1y:Float,p2x:Float,p2y:Float, t:Float,pointx:Float Var, pointy:Float Var)`

Local neg:Float =1-t

pointx:Float = sx * (neg) ^ 3 + 3 * p1x * (neg) ^ 2 * t + 3 * p2x * (neg) * t ^ 2 + ex * t ^ 3

pointy:Float = sy * (neg) ^ 3 + 3 * p1y * (neg) ^ 2 * t + 3 * p2y * (neg) * t ^ 2 + ey * t ^ 3

End Function