Mapping Toolbox | ![]() ![]() |
Transform vector data to a new coordinate system based on a new origin
Syntax
[lat1,lon1] = rotatem(lat,lon,origin,'forward') [lat1,lon1] = rotatem(lat,lon,origin,'inverse') [lat1,lon1] = rotatem(lat,lon,origin,'forward',units
) [lat1,lon1] = rotatem(lat,lon,origin,'inverse',units
)
Description
This command will transform vector map data to a new coordinate system.
An analytical use of the new data can be realized in conjunction with the newpole
command. If a selected point is made the north pole of the new system, then when new vector data is created with rotatem
, the distance of every data point from this new north pole is its new colatitude (90° minus latitude). The absolute difference in the great circle azimuths between every pair of points from their new pole is the same as the difference in their new longitudes.
[lat1,lon1] = rotatem(lat,lon,origin,'forward') transforms latitude and longitude data (lat
and lon
) to their new coordinates (lat1
and lon1
) in a coordinate system resulting from Euler angle rotations as specified by origin
. The input origin
is a three- (or two-) element vector having the form [latitude longitude orientation]
. The latitude and longitude are the coordinates of the point in the original system, which is the center of the output system. The orientation is the azimuth from the new origin point to the original North Pole in the new system. If origin
has only two elements, the orientation is assumed to be 0°. This origin
vector might be the output of putpole
or newpole
.
[lat1,lon1] = rotatem(lat,lon,origin,'inverse') transforms latitude and longitude data (lat
and lon
) in a coordinate system that has been transformed by Euler angle rotations specified by origin
to their coordinates (lat1
and lon1
) in the coordinate system from which they were originally transformed. In a sense, this undoes the 'forward'
process. Be warned, however, that if data is rotated forward and then inverted, the final data may not be identical to the original. This is due to round off and data collapse at the original and intermediate singularities (the poles).
[lat1,lon1] = rotatem(lat,lon,origin,'forward',units
) specifies the angle units of the data, where units
is any recognized angle units string. The default is 'radians'
. Note that this default is different from that of most functions.
Examples
What would the coordinates of Rio de Janeiro (23°S,43°W) be in a coordinate system in which New York (41°N,74°W) was made the north pole? Use the newpole
function to get the origin vector associated with putting New York at the Pole:
nylat = 41; nylon = -74; riolat = -23; riolon = -43; origin = newpole(nylat,nylon); [riolat1,riolon1] = rotatem(riolat,riolon,origin,... 'forward','degrees') riolat1 = 19.8247 riolon1 = -149.7375
What does this mean? For one thing, the colatitude of Rio in this new system is its distance from New York. Compare the distance between the original points and the new colatitude:
See Also
neworig |
Transform regular matrix map to new coordinate system based on a new origin |
newpole |
Select point to place at north pole |
org2pol |
Pole of transformed coordinate system |
putpole |
Origin of transformed coordinate system |
![]() | rootlayr | rotatetext | ![]() |