Hello listers, here's a mathematical problem I have: I have point A and a line with start/end coordinates B and B'. Using MapBasic, how do I determine the shortest distance from point A to any part of that line segment, assuming that the only points on that line are B and B'? The only way I can think to do it is calculating the angle/azimuth of line B-B', then creating a line from point A at a 90� angle from this value, ensuring that it is long enough to pass through some part of B-B' (which would only be the case if neither B nor B' are actually the closest point...) Then I could use targeting commands to create a node where they overlap, and get the coordinate of this location.
Now, I'm pretty sure I can program this. But, as many of us know, MapBasic applications tend to run faster if you can avoid object manipulation and work with pure mathematics. Is there anyone out there that would know how to solve this using just trig functions or calculus? Thanks in advance, I will sum up at the end! Ron Ron Halliday, Cartographer Portolan Geomatics Inc. www.portolan.ca
