Select to view content in your preferred language

lat long to Projection Co-ords (meters)

752
3
01-09-2011 05:34 PM
MatPeek
New Contributor
Hi,

I have the opposite problem of this thread: http://forums.esri.com/Thread.asp?c=158&f=2455&t=280701

My math is terrible I am sorry - I'd be grateful if someone could please re-arrange to lat equation to get the meters value on the LHS (I have tried I promise).

double latitude = (Math.PI / 2) - (2 * Math.Atan(Math.Exp(-1.0 * y / wgs84EarthRadius)));


thanks
Mat.
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
By reversing the formula we get :
var y = -wgs84EarthRadius * Math.Log(Math.Tan((Math.PI / 2 - latitude)/2.0));
Then knowing that Tan²(x/2) = (1 - cos(x)) / (1+cos(x)), we can simplify to:
 var y = wgs84EarthRadius / 2.0 * Math.Log((1.0 + Math.Sin(latitude)) / (1.0 - Math.Sin(latitude)));


Note : latitude in radians
0 Kudos
MatPeek
New Contributor
That worked like a charm, thank you for helping the mathematically challenged.

Regards
Mat
0 Kudos
dotMorten_esri
Esri Notable Contributor
This website is really useful for most spherical geometry calculations: http://williams.best.vwh.net/avform.htm
0 Kudos