This should do it :
public function getPositionOnCurve(p1:Point, p2:Point, p3:Point,
t:Number):Point {
var pos:Point = new Point();
pos.x = Math.pow((1-t),
2)*p1.x+2*t*(1-t)*p2.x+Math.pow(t, 2)*p3.x;
pos.y = Math.pow((1-t),
Quick question...
I have a curveTo between points, but I'd like to get the x,y 1/2 way through
the curve, ON the curve. Googling for some code but haven't seen it yet...
I basically want to join another line to the midpoint of the curve, and the
curve is dynamically moving throughout
A quick way
you guys rock - i'll implement this soon™ and report back.
doesn't matter which way the curve is i imagine (convex/concave)
On 8/9/07, Zeh Fernando <[EMAIL PROTECTED]> wrote:
>
> > Quick question...
> > I have a curveTo between points, but I'd like to get the x,y 1/2 way
> through
> > the curve,
works like a charm. if the curve moves really fast, there is some lag in
getting a line to connect to a point on the curve, but its not too bad
On 8/9/07, eric e. dolecki <[EMAIL PROTECTED]> wrote:
>
> you guys rock - i'll implement this soon™ and report back.
>
> doesn't matter which way the curv
Some more easing curves and another approach
// Quadratic Bezier tween from b to b+c, influenced by p
// t: current time, b: beginning value, c: total change, d: duration
// p: Bezier control point position
function tweenQuadBez (t, b, c, d, p):Number {
return ((t/=d)*c + 2*(1-t)*(p
5 matches
Mail list logo