View Single Post

  #2 (permalink)  
Old 05-24-2004
Winwaed's Avatar
Winwaed Winwaed is offline
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 916
Blog Entries: 11
Is this a straight line? If so:

You can derive it from the principle of like triangles. Or from vector addition.

Let your endpoints be A and B
A = (x1,y1)
B = (x2, y2)

Let Delta = A - B
ie. Delta_X = x1-x2 and Delta_Y = y1-y2

Point P on line = (xp,yp)

xp = x1 + L * Delta_X
yp = y1 + L * Delta_Y

L = Real number in the range 0...1
0 gives A, 1 gives B
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
See the Geoweb Guru for online mapping
Reply With Quote