There are a number of things that you need to be clear
about to answer your question:
- There are three directions commonly referred to
as "North". Magnetic North, Geodetic North and
Grid North. You need to be clear which one you
are using
- Presumably your starting point is a geodetic
location (i.e. Lat/ Long) not a projected one
(i.e. X/Y like UK National Grid or US State Plane)
- What level of precision do you need?
Here are some hints:
- Assuming a spherical earth makes calculations much
simpler but less accurate
- Things get more distorted near the poles, if
you are only interested in locations below the artic
circle you can simplify
- Things get more distorted as distances increase, if
you never want any distance more than 10km then
simple geometry will probably be good enough
You can go all the way from doing a simple bit of trig (e.g.
how long is 1 degree East-West, how long is 1 degree
North-South and interpolate) to using a full blown coordinate
conversion system. You have to decide how much error you
are prepared to tolerate and how much time you want to invest.
A few months ago I looked into
location conversion modules
in CPAN and did not find any that met my needs.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.