## Documentation Center |

Orient regular data grid to oblique aspect

`[Z,lat,lon] = neworig(Z0,R,origin)[Z,lat,lon]
= neworig(Z0,R,origin,'forward')[Z,lat,lon] = neworig(Z0,R,origin,'inverse')`

`[Z,lat,lon] = neworig(Z0,R,origin)` and `[Z,lat,lon]
= neworig(Z0,R,origin,'forward')` will transform regular
data grid `Z0` into an oblique aspect, while preserving
the matrix storage format. In other words, the oblique map origin
is not necessarily at (0,0) in the Greenwich coordinate frame. This
allows operations to be performed on the matrix representing the oblique
map. For example, azimuthal calculations for a point in a data grid
become row and column operations if the data grid is transformed so
that the north pole of the oblique map represents the desired point
on the globe.

`R` can be a geographic raster reference object,
a referencing vector, or a referencing matrix. If `R` is
a geographic raster reference object, its `RasterSize` property
must be consistent with `size(Z)`.

If `R` is a referencing vector, it must be
a 1-by-3 with elements:

[cells/degree northern_latitude_limit western_longitude_limit]

If `R` is a referencing matrix, it must be
3-by-2 and transform raster row and column indices to or from geographic
coordinates according to:

[lon lat] = [row col 1] * R

If `R` is a referencing matrix, it must define
a (non-rotational, non-skewed) relationship in which each column of
the data grid falls along a meridian and each row falls along a parallel.
Nearest-neighbor interpolation is used by default. NaN is returned
for points outside the grid limits or for which `lat` or `lon` contain
NaN. All angles are in units of degrees.

`[Z,lat,lon] = neworig(Z0,R,origin,'inverse')` transforms
the regular data grid from the oblique frame to the Greenwich coordinate
frame.

The `neworig` function transforms a regular
data grid into a new matrix in an altered coordinate system. An analytical
use of the new matrix can be realized in conjunction with the `newpole` function.
If a selected point is made the *north pole* of
the new system, then when a new matrix is created with `neworig`,
each row of the new matrix is a constant distance from the selected
point, and each column is a constant azimuth from that point.

This is the `topo` map transformed to put Sri
Lanka at the North Pole:

load topo origin = newpole(7,80) origin = 83.0000 -100.0000 0 [Z,lat,lon] = neworig(topo,topolegend,origin); axesm miller latlim = [ -90 90]; lonlim = [-180 180]; gratsize = [90 180]; [lat,lon] = meshgrat(latlim,lonlim,gratsize); surfm(lat,lon,Z) demcmap(topo) tightmap

Was this topic helpful?