Skip Menu |

This queue is for tickets about the Geo-Ellipsoids CPAN distribution.

Report information
The Basics
Id: 34450
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Geo-Ellipsoids

People
Owner: Nobody in particular
Requestors: Aleksandar.Jelenak [...] noaa.gov
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Wrong formula in rho_rad()
Date: Wed, 26 Mar 2008 15:36:38 -0400
To: bug-Geo-Ellipsoids [...] rt.cpan.org
From: Aleksandar Jelenak <Aleksandar.Jelenak [...] noaa.gov>
Hello! The formula in the rho_rad() method is not correct. It should be: $a * (1-$e2) / ( 1 - $e2 * sin($lat)**2 )**(3/2) Reference: John P. Snyder, "Map Projections: A Working Manual", USGS, page 24, equation (4-18) (available as PDF from <http://pubs.er.usgs.gov/usgspubs/pp/pp1395>). Best regards, Aleksandar
This bug was fix in Geo-Ellipsoids-0.16 27May2008. sub n_rad { @@ -300,10 +306,12 @@ sub rho { =head2 rho_rad -rho is the radius of curvature of the earth in the meridian plane. +rho is the radius of curvature of the earth in the meridian plane. Sometimes denoted as R'. my $rho=$obj->rho_rad($lat); +Reference: John P. Snyder, "Map Projections: A Working Manual", USGS, page 24, equation (4-18) http://pubs.er.usgs.gov/usgspubs/pp/pp1395 + =cut sub rho_rad { @@ -312,7 +320,8 @@ sub rho_rad { die("Error: Latitude (radians) required.") unless defined $lat; my $a=$self->a; my $e2=$self->e2; - return $a * (1-$e2) / sqrt(1 - $e2 * sin($lat)**(3/2)); + return $a * (1-$e2) / ( 1 - $e2 * sin($lat)**2 )**(3/2) + #return $a * (1-$e2) / sqrt(1 - $e2 * sin($lat)**(3/2)); #Bad formula from somewhere }