in reply to How do I compute the longitude and latitude of a point at a certain distance?
The simple answer is, "With trigonometry."
I don't know the answer off the top of my head but I ++'ed because I think this will yield an excellent response. (And although it isn't a Perl question, Perl can be used to solve it.)
From what I do remember, you'll need the distance and bearing to the landmark. (And you postulate that as the starting information.) That line segment becomes hypoteneuse of a right triangle between your target and the landmark.
The length of the hypoteneuse would not be enough to solve for the triangle's sides normally, but with the bearing, (presuming that you limit yourself to 8 or 16 cardinal directions, (ie. only N, NW, and maybe NNW and so forth...) you could estimate the ratio between the length of the sides. You'd still only narrow your solution set down to four possibilities this way, but the direction also allows you to know if the East-West delta is positive or negative. Same for North-South.
The last thing you'll have to account for is the latitude. You see, the formula for converting a degree of longitude into distance will be driven by your distance from the equator. (Damn this oblate spheroid anyway. Our algorithms were much simpler when we kept current on our dues to the Flat Earth Society.)
Sorry I couldn't pause long enough to cobble something up in Perl. I promised myself that I'd only stop to read one more node before returning to life. I just couldn't resist enumerating the algorithmic considerations here. Perhaps it will help another puzzle-solver.
...All the world looks like -well- all the world,
when your hammer is Perl.
---v
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I compute the longitude and latitude of a point at a certain distance?
by agentv (Friar) on Apr 21, 2003 at 23:57 UTC |