image thumbnail

Rotated grid transform

version 1.0.0.0 (1.81 KB) by Simon Funder
Transforms coordinates from regular to rotated grid and vice versa.

948 Downloads

Updated 10 Sep 2013

View License

This functions transforms a set of coordinates in regular lon/lat degrees, grid_in = [lon, lat], to a set of coordinates in rotated lon/lat degrees, grid_out = [lon', lat'], and vice versa:

[grid_out] = rotated_grid_transform(grid_in, option, SP_coor)

where option is the 'direction' of the transform (1: regular -> rotated and 2: rotated -> regular) and SP_coor are the coordinates of the South Pole in the rotated grid [SP_lon, SP_lat]

Example:
SP_coor = [18 -39.3];
grid_in = [[12; 12; 12],[55; 54; 53]];
[grid_out] = rotated_grid_transform(grid_in, 1, SP_coor)

grid_out =

-3.4476 4.4397
-3.5289 3.4430
-3.6100 2.4463

grid_in = grid_out;
[grid_out] = rotated_grid_transform(grid_in, 2, SP_coor)

grid_out =

12.0000 55.0000
12.0000 54.0000
12.0000 53.0000

Reference:
http://gis.stackexchange.com/questions/10808/lon-lat-transformation/14445

Cite As

Simon Funder (2021). Rotated grid transform (https://www.mathworks.com/matlabcentral/fileexchange/43435-rotated-grid-transform), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!