If anyone else has a better way I would love to hear it.

Totally curved lines? or zig-zag with corners? or both?

Try breaking the path travelled down to points. If you can calculate the distance between the last point and a new point made, you just need to sum up the values.
example map/ path travelled.

start
.___.
.____\.
|.________.
._______./
finish

just sum up the distances to find the total distance travelled.

You will need to know basic the Pythagorean theorem, to find the length of a hypotenuse/distance between to points for straight lines, and if you need to calculate the curves it actually depends on the type of curve, so you will need to know this info.

more info on curves...found it on google, if you don't know how to do these calculations it will take you a little time to work your way through the math:
http://www.mathwords.com/a/arc_length_of_a_curve.htm

hope that helps,
Anthony



allandt bik-elliott (thefieldcomic.com) wrote:
Hi guys

I have a bit of maths problem to solve here and I've not found any answers
on the Googles.

I have several squiggly lines (they will be maps) and I need to find out, if
a user clicks somewhere on one of the lines, how far along the line they've
clicked. I also need to find out how long the line would be.

How would I go about doing this, please?

Hope you can help
A
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to