Warning: Undefined array key 1 in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 431

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/actions.php on line 38
tips:longlat [Elmer/Ice Wiki]

# Longitude / Latitude

How to defined the Longitude/Latitude as a function of stereographic projected Cartesian coordinates?

This is an example that is being used for Dome F region, EAIS, with input coordinated from the projection on -71 degrees latitude (with R=6371 km):

```\$ function longitude(X)  { _longitude = atan(X(0)/X(1))*360/(2*pi) }
\$ function latitude(X)  {\
_latitude = (-pi/2 + 2 * atan(sqrt(X(0)*X(0) + X(1)*X(1))/(2*6371225*0.97276)))*360/(2*pi);\
}```

One has to declare the variables `longitude` and `latitude` as exported variables in a solver:

```Exported Variable 1 = String "Longitude"
Exported Variable 1 DOFs = 1
Exported Variable 2 = String "Latitude"
Exported Variable 2 DOFs = 1```

and then initialize it in the initial condition for the body on which this particular solver is run:

```Longitude = Variable Coordinate
Real MATC "longitude(tx)"
Latitude = Variable Coordinate
Real MATC "latitude(tx)"```