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), 2)*p1.y+2*t*(1-t)*p2.y+Math.pow(t, 2)*p3.y; return pos; }
P1 is the start point of the curve (moveTo(p1.x, p1.y)) P2 the control point P3 the end point (curveTo(p2.x, p2.y, p3.x, p3.y)) T is a number between 0 and 1, .5 for halfway -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of eric e. dolecki Sent: 09 August 2007 17:19 To: Flashcoders mailing list Subject: [Flashcoders] Finding a spot on a curveTo Line 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 - eric _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com