Latitude and Longitude

Two angles, latitude and longitude, specify the position of a point on the surface of a planet. These angles can be in degrees or radians; however, degrees are far more common in geographic notation.

Latitude is the angle between the plane of the equator and a line connecting the point in question to the planet's rotational axis. There are different ways to construct such lines, corresponding to different types of and resulting values for latitudes. Latitude is positive in the northern hemisphere, reaching a limit of +90° at the north pole, and negative in the southern hemisphere, reaching a limit of -90° at the south pole. Lines of constant latitude are called parallels.

Longitude is the angle at the center of the planet between two planes that align with and intersect along the axis of rotation, perpendicular to the plane of the equator. One plane passes through the surface point in question, and the other plane is the prime meridian (0° longitude), which is defined by the location of the Royal Observatory in Greenwich, England. Lines of constant longitude are called meridians. All meridians converge at the north and south poles (90°N and -90°S), and consequently longitude is under-specified in those two places.

Longitudes typically range from -180° to +180°, but other ranges can be used, such as 0° to +360°. Longitudes can also be specified as east of Greenwich (positive) and west of Greenwich (negative). Adding or subtracting 360° from its longitude does not alter the position of a point. The toolbox includes a set of functions (wrapTo180, wrapTo360, wrapToPi, and wrapTo2Pi) that convert longitudes from one range to another. It also provides unwrapMultipart, which "unwraps" vectors of longitudes in radians by removing the artificial discontinuities that result from forcing all values to lie within some 360°-wide interval.

Plot Latitude and Longitude

This example shows how to plot latitude and longitude.

load coastlines
axesm('ortho','origin',[45 45]); 
axis off;
gridm on; 
framem on;