Python trig precision problem

casevh at comcast.net casevh at comcast.net
Thu May 18 23:56:58 CEST 2006


Cary West wrote:
> Hello all, having a small problem with a trig routine using python math
> module. This code is designed to convert geodetic coordinates to lambert
> conformal conic coordinates. It implements the formulas found at
> http://mathworld.wolfram.com/LambertConformalConicProjection.html .  The
> problem is that, at least on my machine, the precision is off to the tune of
> around 1 km, which is unacceptable. (using the calculator found at
> http://www.deh.gov.au/erin/tools/geo2lam-gda.html ) Anyone have any ideas?
> here is the offending code.
>

I'd assume you are exceeding the precision available with standard
64-bit floating point. Here is a library for extended precision
floating point, including trig functions.

http://calcrpnpy.sourceforge.net/clnumManual.html

casevh




More information about the Python-list mailing list