Hi,

The function that I gave you  (A*x +x^2) was an arbitrary example.

Looks like you'd need to use what ever bezier math is used by the Flash player to represent the line. Not the easiest thing to figure out, but here's a link that might help:
http://www.moshplant.com/direct-or/bezier/math.html

There might be tricks that we're not thinking of. For instance - take a bitmap snapshot of it in memory. Then use getPixel(x, y) to walk which ever column you're in until you reach a black pixel (or non-alpha if you use getPixel32). That's your y.

Another trick is to position the clips on the line where they need to be when the line is at rest. Then displace them vertically based on the amplitude of the center displacement.

Good luck.

Jobe Makar
http://www.electrotank.com
http://www.electro-server.com
phone: 252-627-8026
mobile: 919-609-0408
fax: 919-882-1121
----- Original Message ----- From: "leolea" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, April 25, 2007 4:28 PM
Subject: Re: [Flashcoders] Curves question for math gurus



Hi, thanks for your reply!

My curve isn't exactly a circle. Here's what my animated curve would look
like:
http://pages.videotron.com/poubou/flash/cannes01.html


The curve is drawn using the drawing API:
example:
mc.moveTo(0,0);
mc.curveTo(400,900,0,800);

So, I know the 3 bezier points that define my curve:
startpoint = 0,0
middlepoint = 400,900
endpoint = 800,0

With those values in hand, how can I apply them to your function:
f(x) = A*x + x^2


Do I make any sense?




On 4/25/07 3:50 PM, "Jobe Makar" <[EMAIL PROTECTED]> wrote:

Hi,

Your typical funciton looks something like this in math books:

f(x) = A*x + x^2 //just an example

Where f(x) is essentially 'y'. So, you just need the equation that defines
your curve. The curve in your jpg appears to be a circle.

y = sqrt(x^2 + r^2) //where r is the radius

That actually yields + or - and you just pick what fits your situation best.
So, you pump in an x and get you 2 y's. Pick the best y and use it.


_______________________________________________
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

Reply via email to