in reply to Re^2: Lat/Lon to V&H conversion
in thread Lat/Lon to V&H conversion

There is an issue with sign I did not really bother to diagnose. I was not sure if it was an error with the toVH or the toLatLon function as the only sample data I found used negative Longitudes (so it looked like toVH was wrong) but toVH agreed with the existing module results. If you enter -104 degrees for the longitude it works exactly as expected.

V = 7349.7333432988 Latitude = 40.423792190582 H = 5909.05477294282 Longitude = -104.791265047498

I was to lazy to grok why it should be so. There are comments about the sign for E-W and N-S and also notes that it is US centric. I would be interested in some clarification on the sign issue. Evidently one is 'wrong'. Its easy to fix of course.

With the XS code (which will be around 100x faster than pure perl) you need to import the functions you want to avoid a fully qualified call. It is good practice with modules not to export by default.

# import all the available functions specifying by name use Geo::Coordinates::VandH::XS qw( toVH toLatLon distance degrees rad +ians ); # or as documented in the very sparse docs ;-) use Geo::Coordinates::VandH::XS qw( :all );

cheers

tachyon

Replies are listed 'Best First'.
Re^4: Lat/Lon to V&H conversion
by jcoxen (Deacon) on Oct 15, 2004 at 21:18 UTC
    I figured the sign thing out just a few minutes ago and was turning to PerlMonks to post my stupidity when I saw that you had figured it out ahead of me. The rhythmic thumping sound you hear in the background is me pounding my head against my desk.

    V&H is VERY US centric. It's a Ma Bell invention from the late 50's when they were THE telephone monopoly. My guess is they were throwing in their own obfuscation to keep themselves a monopoly. BTW, if you go here, you'll see a map showing the V&H grid system. Note the relationship of the grid to a North-South axis and how the origin of the grid is upper-right as opposed to the normal lower-left. Add to that the fact that the paper describing the V&H system and the conversion to/from Lat/Lon is 109 freaking pages long and I don't think clarity and ease of use were primary considerations.

    Anyway, thank you VERY much for your module and your help. You've been a life saver.

    Jack

    Cogito cogito, ergo cogito sum
    (I think I think, therefore I think I am)