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
In reply to Re^3: Lat/Lon to V&H conversion
by tachyon
in thread Lat/Lon to V&H conversion
by jcoxen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |