...that's an excellent question.

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


In reply to Re: How do I compute the longitude and latitude of a point at a certain distance? by agentv
in thread How do I compute the longitude and latitude of a point at a certain distance? by themaetrix

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.