length of B: 124.40 - 66.90 = 57.5
length traversed along B: 80.6 - 66.92 = 13.68
proportion of B traversed: 13.68/57.5 = 0.237913043

length of A = 799 - 0 = 799
proportion of A traversed: 0.237913043
length traversed along A: 0.237913043 * 799 = 190.0925217

If your screen width is 800 pixels ( 0 to 799), you want pixel 0 +190.0925217 pixel steps, so that's pixel 190. In some cases you might want to round it up with int(0 +190.0925217 + 0.5) - still 190.

John

On 10/09/2010 12:24, Lehr, Theodore wrote:
So if I have to line segments:

A: 0-799
B: 66.92 - 124.40


Given a point on B (80.6 for example) how can I find the equivalent point on 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