Variables in explanation
long1 is the longitude varying from -180 to 180 or 180W-180E
long3 is the longitude variable from 0 to 360 (all positive)
To convert longitude from (0-360) to (-180 to 180)
Matlab and fortran
long1=mod((long3+180),360)-180
Matlab
long1=rem((long3+180),360)-180
Fortran
long1=modulo((long3+180),360)-180
To convert longitude from (-180 to 180) to (0-360)
Matlab
lon3=mod(lon1,360)
Fortran
lon3=modulo(lon1,360)
The “mod” function is Fortran is equivalent to “rem” function in Matlab.
The “modulo” function in Fortran is equivalent to “mod” function in Matlab.
Tuesday, June 29, 2010
Convert Longitude 0-360 to -180 to 180 or 180W-180E in fortran and matlab, transform lat lon coordinates
Posted by
vicky
at
9:23 AM
Subscribe to:
Post Comments (Atom)
Popular
- Unbelievable invention of Bheema's skeleton or Bhima's son Gadotkach like skeleton found: A hoax mail
- Online status of permesso di soggiorno on the website of Polizia di Stato
- SBI transaction on 30-Nov-0019 for INTERNET BANKING, what is this for?
- Matlab boxplot: how to change the line width (LineWidth) and color of the lines?
- Convert Longitude 0-360 to -180 to 180 or 180W-180E in fortran and matlab, transform lat lon coordinates
Amazing stuff...post more
ReplyDeleteTHANKS A LOT !!!
ReplyDeletesaved me so much hassle!
ReplyDelete