.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Geo::Ellipsoids 3pm" .TH Geo::Ellipsoids 3pm "2022-12-08" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Geo::Ellipsoids \- Package for standard Geo:: ellipsoid a, b, f and 1/f values. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 9 \& use Geo::Ellipsoids; \& my $obj = Geo::Ellipsoids\->new(); \& $obj\->set(\*(AqWGS84\*(Aq); #default \& print "a=", $obj\->a, "\en"; \& print "b=", $obj\->b, "\en"; \& print "f=", $obj\->f, "\en"; \& print "i=", $obj\->i, "\en"; \& print "e=", $obj\->e, "\en"; \& print "n=", $obj\->n(45), "\en"; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new" .IX Subsection "new" The \fBnew()\fR constructor may be called with any parameter that is appropriate to the set method. .PP .Vb 1 \& my $obj = Geo::Ellipsoid\->new(); .Ve .SH "METHODS" .IX Header "METHODS" .SS "set" .IX Subsection "set" Method sets the current ellipsoid. This method is called when the object is constructed (default is \s-1WGS84\s0). .PP .Vb 3 \& $obj\->set(); #default WGS84 \& $obj\->set(\*(AqClarke 1866\*(Aq); #All built in ellipsoids are stored in meters \& $obj\->set({a=>1, b=>1}); #Custom Sphere 1 unit radius .Ve .SS "list" .IX Subsection "list" Method returns a list of known elipsoid names. .PP .Vb 1 \& my @list=$obj\->list; \& \& my $list=$obj\->list; \& while (@$list) { \& print "$_\en"; \& } .Ve .SS "a" .IX Subsection "a" Method returns the value of the semi-major axis. .PP .Vb 1 \& my $a=$obj\->a; .Ve .SS "b" .IX Subsection "b" Method returns the value of the semi-minor axis. .PP .Vb 1 \& my $b=$obj\->b; #b=a(1\-f) .Ve .SS "f" .IX Subsection "f" Method returns the value of flatting .PP .Vb 1 \& my $f=$obj\->f; #f=(a\-b)/a .Ve .SS "i" .IX Subsection "i" Method returns the value of the inverse flatting .PP .Vb 1 \& my $i=$obj\->i; #i=1/f=a/(a\-b) .Ve .SS "invf" .IX Subsection "invf" Method synonym for the i method .PP .Vb 1 \& my $i=$obj\->invf; #i=1/f .Ve .SS "e" .IX Subsection "e" Method returns the value of the first eccentricity, e. This is the eccentricity of the earth's elliptical cross-section. .PP .Vb 1 \& my $e=$obj\->e; .Ve .SS "e2" .IX Subsection "e2" Method returns the value of eccentricity squared (e.g. e^2). This is not the second eccentricity, e' or e\-prime see the \*(L"ep\*(R" method. .PP .Vb 1 \& my $e=sqrt($obj\->e2); #e^2 = f(2\-f) = 2f\-f^2 = 1\-b^2/a^2 .Ve .SS "ep" .IX Subsection "ep" Method returns the value of the second eccentricity, e' or e\-prime. The second eccentricity is related to the first eccentricity by the equation: 1=(1\-e^2)(1+e'^2). .PP .Vb 1 \& my $ep=$obj\->ep; .Ve .SS "ep2" .IX Subsection "ep2" Method returns the square of value of second eccentricity, e' (e\-prime). This is more useful in almost all equations. .PP .Vb 1 \& my $ep=sqrt($obj\->ep2); #ep2=(ea/b)^2=e2/(1\-e2)=a^2/b^2\-1 .Ve .SS "n" .IX Subsection "n" Method returns the value of n given latitude (degrees). Typically represented by the Greek letter nu, this is the radius of curvature of the ellipsoid perpendicular to the meridian plane. It is also the distance from the point in question to the polar axis, measured perpendicular to the ellipsoid's surface. .PP .Vb 1 \& my $n=$obj\->n($lat); .Ve .PP Note: Some define a variable n as (a\-b)/(a+b) this is not that variable. .PP Note: It appears that n can also be calculated as .PP .Vb 1 \& n=a^2/sqrt(a^2 * cos($lat)^2 + $b^2 * sin($lat)^2); .Ve .SS "n_rad" .IX Subsection "n_rad" Method returns the value of n given latitude (radians). .PP .Vb 1 \& my $n=$obj\->n_rad($lat); .Ve .PP Reference: John P. Snyder, \*(L"Map Projections: A Working Manual\*(R", \s-1USGS,\s0 page 25, equation (4\-20) http://pubs.er.usgs.gov/usgspubs/pp/pp1395 .SS "rho" .IX Subsection "rho" rho is the radius of curvature of the earth in the meridian plane. .PP .Vb 1 \& my $rho=$obj\->rho($lat); .Ve .SS "rho_rad" .IX Subsection "rho_rad" rho is the radius of curvature of the earth in the meridian plane. Sometimes denoted as R'. .PP .Vb 1 \& my $rho=$obj\->rho_rad($lat); .Ve .PP Reference: John P. Snyder, \*(L"Map Projections: A Working Manual\*(R", \s-1USGS,\s0 page 24, equation (4\-18) http://pubs.er.usgs.gov/usgspubs/pp/pp1395 .SS "polar_circumference" .IX Subsection "polar_circumference" Method returns the value of the semi-minor axis times 2*PI. .PP .Vb 1 \& my $polar_circumference=$obj\->polar_circumference; .Ve .SS "equatorial_circumference" .IX Subsection "equatorial_circumference" Method returns the value of the semi-major axis times 2*PI. .PP .Vb 1 \& my $equatorial_circumference=$obj\->equatorial_circumference; .Ve .SS "shortname" .IX Subsection "shortname" Method returns the shortname, which is the hash key, of the current ellipsoid .PP .Vb 1 \& my $shortname=$obj\->shortname; .Ve .SS "longname" .IX Subsection "longname" Method returns the long name of the current ellipsoid .PP .Vb 1 \& my $longname=$obj\->longname; .Ve .SS "data" .IX Subsection "data" Method returns a hash reference for the ellipsoid definition data structure. .PP .Vb 1 \& my $datastructure=$obj\->data; .Ve .SS "name2ref" .IX Subsection "name2ref" Method returns a hash reference (e.g. {a=>6378137,i=>298.257223563}) when passed a valid ellipsoid name (e.g. '\s-1WGS84\s0'). .PP .Vb 1 \& my $ref=$obj\->name2ref(\*(AqWGS84\*(Aq) .Ve .SH "TODO" .IX Header "TODO" What should we do about bad input? I tend to die in the module which for most situations is fine. I guess you could always overload die to handle exceptions for web based solutions and the like. .PP Support for ellipsoid aliases in the data structure .SH "BUGS" .IX Header "BUGS" Please send to the geo-perl email list. .SH "LIMITS" .IX Header "LIMITS" No guarantees that Perl handles all of the double precision calculations in the same manner as Fortran. .SH "AUTHOR" .IX Header "AUTHOR" Michael R. Davis qw/perl michaelrdavis com/ .SH "LICENSE" .IX Header "LICENSE" Copyright (c) 2006 Michael R. Davis (mrdvt92) .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" Geo::Forward Geo::Ellipsoid Geo::Coordinates::UTM Geo::GPS::Data::Ellipsoid GIS::Distance