OSGeo / PROJ

PROJ - Cartographic Projections and Coordinate Transformations Library
https://proj.org
Other
1.67k stars 761 forks source link

Doc: wrong formulas for the legacy ellipsoidal form in tmerc.html #3558

Open rouault opened 1 year ago

rouault commented 1 year ago

The formulas for the "Legacy ellipsoidal form" don't match the maths in the code. For the foward case, the N and R in the doc is not used anywhere. The 1./ sqrt (1. - P->es sinphi sinphi) term of the .cpp file isn't found in the formulas. The y formula fails to take into account k0 as a multiplicative factor for M(phi), and also doesn't take into account M(phi0). And perhaps other things I've missed...

(controversial opinion: doc always lie, the code never :-))

busstoptaktik commented 1 year ago

(controversial opinion: doc always lie, the code never :-))

I'm on the fence regarding the former, but at least I'm tempted to agree on the latter, despite Ken Thompson's Reflections on trusting trust :-)