in reply to Re: Algorithm: point with N distance of a line between two other points in thread Algorithm: point with N distance of a line between two other points
Yes, LR, my initial idea had been to solve a quadratic equation and test the values of the two solutions. But I've found that Math::Geometry::Planar's DistanceToSegment() function works well with cartesian coordinates.
I'm facing two problems, though: 1) I'm starting with lat/long coordinates, not cartesian coordinates; and 2) I'd like the algorithm to run in a mysql query. I already have a GEO_DISTANCE(lat1,lng1,lat2,lng2) function in mysql, and I can reproduce DistanceToSegment() in mysql, but I'm not confident that DistanceToSegment() works appropriately with lat/long coordinates. Any ideas here?
Re^3: Algorithm: point with N distance of a line between two other points by Limbic~Region (Chancellor) on Nov 04, 2010 at 02:05 UTC 
japhy,
The shortest distance between two points on a sphere (forget that Earth is squished a bit) is the arc of the great circle passing between those two points so you may have reason for concern. You should read this and this (Crosstrack distance). You may find that treating the surface of the sphere as a flat plane acceptable if your talking about a small enough area  otherwise, you need nonplanar math.
Regarding your statement about MySQL query  I assume have no idea what builtin trig functions are available and I don't envy reimplementing them from scratch. If this were Pg, you could just use plperl and use the module that did what you wanted :)
 [reply] 
