1Geo::Forward(3) User Contributed Perl Documentation Geo::Forward(3)
2
3
4
6 Geo::Forward - Calculate geographic location from latitude, longitude,
7 distance, and heading.
8
10 use Geo::Forward;
11 my $gf = Geo::Forward->new(); # default "WGS84"
12 my ($lat1, $lon1, $faz, $dist) = (38.871022, -77.055874, 62.888507083, 4565.6854);
13 my ($lat2, $lon2, $baz) = $gf->forward($lat1, $lon1, $faz, $dist);
14 print "Input Lat: $lat1 Lon: $lon1\n";
15 print "Input Forward Azimuth: $faz (degrees)\n";
16 print "Input Distance: $dist (meters)\n";
17 print "Output Lat: $lat2 Lon: $lon2\n";
18 print "Output Back Azimuth: $baz (degreees)\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 $gf = Geo::Forward->new(); # default "WGS84"
30
32 initialize
33 ellipsoid
34 Method to set or retrieve the current ellipsoid object. The ellipsoid
35 is a Geo::Ellipsoids object.
36
37 my $ellipsoid = $gf->ellipsoid; #Default is WGS84
38
39 $gf->ellipsoid('Clarke 1866'); #Built in ellipsoids from Geo::Ellipsoids
40 $gf->ellipsoid({a=>1}); #Custom Sphere 1 unit radius
41
42 forward
43 This method is the user frontend to the mathematics. This interface
44 will not change in future versions.
45
46 my ($lat2, $lon2, $baz) = $gf->forward($lat1, $lon1, $faz, $dist);
47
48 Note: Latitude and longitude units are signed decimal degrees. The
49 distance units are based on the ellipsoid semi-major axis which is
50 meters for WGS-84. The forward and backward azimuths units are signed
51 degrees clockwise from North.
52
53 bbox
54 Returns a hash reference for the bounding box around a point with the
55 given radius.
56
57 my $bbox = $gf->bbox($lat, $lon, $radius); #isa HASH {north=>$north, east=>$east, south=>$south, west=>$west}
58
59 Note: This is not an optimised solution input is welcome
60
61 UOM: radius units of semi-major axis (default meters for WGS-84)
62
64 Please open an issue on GitHub
65
67 No guarantees that Perl handles all of the double precision
68 calculations in the same manner as Fortran.
69
71 MIT License
72
73 Copyright (c) 2022 Michael R. Davis
74
76 Similar Packages
77
78 Geo::Distance, Geo::Ellipsoid, Geo::Calc
79
80 Opposite Package
81 Geo::Inverse
82
83 Building Blocks
84 Geo::Ellipsoids, Geo::Constants, Geo::Functions
85
86
87
88perl v5.38.0 2023-07-20 Geo::Forward(3)