Document QWebMercator a bit and clean up its qmath.h usage


Use qDegreesToRadians() and qRadiansToDegrees() in preference to
multiplying by pi/180 or 180/pi and restructure the arithmetic using
them to be a bit easier to follow. This hopefully also makes clearer
where M_PI is used for other reasons (to scale a logarithm, or the
parameter to exp() on the way back) that it's not about converting
degrees to radians. It also makes it easier to see that the two
conversions are mutually inverse.

Changed variable names to make clear where we're converting from one
coordinate system to the other, rather than reusing longitude's name
for x and latitude's for y. Simplified the inverse's logic for mapping
x back into the unit interval by first modifying the local x variable
if negative to make it positive (effectively adding an inteter to it).

Explain what the transformation is doing and how it departs from
orthodoxy and selects its choice of parameterisation in Mercator
coordinates. Clarify the existing comment about the clipping of the
y-coordinate.

Pick-to: 6.11
Change-Id: I601fe2e20015ebeff98da5b8c6fde606f14cafde
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commitc384928185dcc839b1f7e8d12d0d3d9e41ce994d
parent7e81c07241c3cd65e1f8890de24b99ba4d272e5c
authorEdward Welbourne <edward.welbourne@qt.io>
committerEdward Welbourne <edward.welbourne@qt.io>
commit timeFri, 12 Dec 2025 15:48:15 +0100