1Geo::Forward(3) User Contributed Perl Documentation Geo::Forward(3)
2
3
4
6 Geo::Forward - Calculate geographic location from lat, lon, distance,
7 and heading.
8
10 use Geo::Forward;
11 my $obj = Geo::Forward->new(); # default "WGS84"
12 my ($lat1,$lon1,$faz,$dist)=(38.871022, -77.055874, 62.888507083, 4565.6854);
13 my ($lat2,$lon2,$baz) = $obj->forward($lat1,$lon1,$faz,$dist);
14 print "Input Lat: $lat1 Lon: $lon1\n";
15 print "Input Forward Azimuth: $faz\n";
16 print "Input Distance: $dist\n";
17 print "Output Lat: $lat2 Lon: $lon2\n";
18 print "Output Back Azimuth: $baz\n";
19
21 This module is a pure Perl port of the NGS program in the public domain
22 "forward" by Robert (Sid) Safford and Stephen J. Frakes.
23
25 new
26 The new() constructor may be called with any parameter that is
27 appropriate to the ellipsoid method which establishes the ellipsoid.
28
29 my $obj = Geo::Forward->new(); # default "WGS84"
30
32 ellipsoid
33 Method to set or retrieve the current ellipsoid object. The ellipsoid
34 is a Geo::Ellipsoids object.
35
36 my $ellipsoid=$obj->ellipsoid; #Default is WGS84
37
38 $obj->ellipsoid('Clarke 1866'); #Built in ellipsoids from Geo::Ellipsoids
39 $obj->ellipsoid({a=>1}); #Custom Sphere 1 unit radius
40
41 forward
42 This method is the user frontend to the mathematics. This interface
43 will not change in future versions.
44
45 my ($lat2,$lon2,$baz) = $obj->forward($lat1,$lon1,$faz,$dist);
46
48 Add tests for more ellipsoids.
49
51 Please send to the geo-perl email list.
52
54 No guarantees that Perl handles all of the double precision
55 calculations in the same manner as Fortran.
56
58 Michael R. Davis qw/perl michaelrdavis com/
59
61 Copyright (c) 2006 Michael R. Davis (mrdvt92)
62
63 This library is free software; you can redistribute it and/or modify it
64 under the same terms as Perl itself.
65
67 Net::GPSD Geo::Spline Geo::Ellipsoid Geo::Ellipsoids
68
69
70
71perl v5.12.0 2006-12-10 Geo::Forward(3)