man(1) Manual page archive


     PROJ(3X)                    (bowell)                     PROJ(3X)

     NAME
          orient, normalize - map projections

     SYNOPSIS
          orient(lat, lon, rot)
          double lat, lon, rot;

          normalize(p)
          struct place *p;

     DESCRIPTION
          Users of map(7) may skip to the description of `Projection
          generators' below.

          The functions orient and normalize plus a collection of map
          projection generators are loaded by option -lmap of ld(1).
          Most of them calculate maps for a spherical earth.  Each map
          projection is available in one standard form, into which
          data must be normalized for transverse or nonpolar projec-
          tions.

          Each standard projection is displayed with the Prime Merid-
          ian (longitude 0) being a straight vertical line, along
          which North is up.  The orientation of nonstandard projec-
          tions is specified by orient. Imagine a transparent gridded
          sphere around the globe.  First turn the overlay about the
          North Pole so that the Prime Meridian (longitude 0) of the
          overlay coincides with meridian lon on the globe.  Then tilt
          the North Pole of the overlay along its Prime Meridian to
          latitude lat on the globe.  Finally again turn the overlay
          about its `North Pole' so that its Prime Meridian coincides
          with the previous position of (the overlay's) meridian rot.
          Project the desired map in the standard form appropriate to
          the overlay, but presenting information from the underlying
          globe.  It is not useful to use orient without using
          normalize.

          Normalize converts latitude-longitude coordinates on the
          globe to coordinates on the overlaid grid.  The coordinates
          and their sines and cosines are input to normalize in a
          place structure.  Transformed coordinates and their sines
          and cosines are returned in the same structure.

                  struct place {
                          double radianlat, sinlat, coslat;
                          double radianlon, sinlon, coslon;
                  };

          The projection generators return a pointer to a function
          that converts normalized coordinates to x-y coordinates for

     PROJ(3X)                    (bowell)                     PROJ(3X)

          the desired map, or 0 if the required projection is not
          available.  The returned function is exemplified by proj in
          this example:

                  struct place pt;
                  int (*proj)() = mercator();
                  double x, y;

                  orient(45.0, 30.0, 180.0);      /* set coordinate rotation */

                  . . .                           /* fill in the pt structure */
                  normalize(&pt);                 /* rotate coordinates */
                  if((*proj)(&pt, &x, &y) > 0)    /* project onto x,y plane */
                          plot(x, y);

          The projection function (*proj)() returns 1 for a good
          point, 0 for a point on a wrong sheet (e.g. the back of the
          world in a perspective projection), and -1 for a point that
          is deemed unplottable (e.g. points near the poles on a Mer-
          cator projection).

          Scaling may be determined from the x-y coordinates of
          selected points.  Latitudes and longitudes are measured in
          degrees for ease of specification for orient and the projec-
          tion generators but in radians for ease of calculation for
          normalize and proj. In either case latitude is measured pos-
          itive north of the equator, and longitude positive west of
          Greenwich.  Radian longitude should be limited to the range
          -pi <= lon < pi.

        Projection generators
          Equatorial projections centered on the Prime Meridian (lon-
          gitude 0).  Parallels are straight horizontal lines.
               mercator() equally spaced straight meridians, confor-
               mal, straight compass courses
               sinusoidal() equally spaced parallels, equal-area, same
               as bonne(0)
               cylequalarea(lat0) equally spaced straight meridians,
               equal-area, true scale on lat0
               cylindrical() central projection on tangent cylinder
               rectangular(lat0) equally spaced parallels, equally
               spaced straight meridians, true scale on lat0
               gall(lat0) parallels spaced stereographically on prime
               meridian, equally spaced straight meridians, true scale
               on lat0
               mollweide() (homalographic) equal-area, hemisphere is a
               circle

          Azimuthal projections centered on the North Pole.  Parallels
          are concentric circles.  Meridians are equally spaced radial
          lines.
               azequidistant() equally spaced parallels, true

     PROJ(3X)                    (bowell)                     PROJ(3X)

               distances from pole
               azequalarea() equal-area
               gnomonic() central projection on tangent plane,
               straight great circles
               perspective(dist) viewed along earth's axis dist earth
               radii from center of earth
               orthographic() viewed from infinity
               stereographic() conformal, projected from opposite pole
               laue() radius = tan(2×colatitude), used in xray crys-
               tallography
               fisheye(n) stereographic seen from just inside medium
               with refractive index n
               newyorker(r) radius = log(colatitude/r): extreme `fish-
               eye' view from pedestal of radius r degrees

          Polar conic projections symmetric about the Prime Meridian.
          Parallels are segments of concentric circles.  Except in the
          Bonne projection, meridians are equally spaced radial lines
          orthogonal to the parallels.
               conic(lat0) central projection on cone tangent at lat0
               simpleconic(lat0,lat1) equally spaced parallels, true
               scale on lat0 and lat1
               lambert(lat0,lat1) conformal, true scale on lat0 and
               lat1
               albers(lat0,lat1) equal-area, true scale on lat0 and
               lat1
               bonne(lat0) equally spaced parallels, equal-area, par-
               allel lat0 developed from tangent cone

          Projections with bilateral symmetry about the Prime Meridian
          and the equator.
               polyconic() parallels developed from tangent cones,
               equally spaced along Prime Meridian
               aitoff() equal-area projection of globe onto 2-to-1
               ellipse, based on azequalarea
               lagrange() conformal, maps whole sphere into a circle
               bicentric(lon0) points plotted at true azimuth from two
               centers on the equator at longitudes ±lon0, great cir-
               cles are straight lines (a stretched gnomonic projec-
               tion)
               elliptic(lon0) points are plotted at true distance from
               two centers on the equator at longitudes ±lon0
               globular() hemisphere is circle, circular arc meridians
               equally spaced on equator, circular arc parallels
               equally spaced on 0- and 90-degree meridians
               vandergrinten() sphere is circle, meridians as in
               globular, circular arc parallels resemble mercator

          Doubly periodic conformal projections.
               guyou() W and E hemispheres are square
               square() world is square with Poles at diagonally oppo-
               site corners

     PROJ(3X)                    (bowell)                     PROJ(3X)

               tetra() map on tetrahedron with edge tangent to Prime
               Meridian at S Pole, unfolded into equilateral triangle
               hex() world is hexagon centered on N Pole, N and S
               hemispheres are equilateral triangles

          Miscellaneous projections.
               harrison(dist,angle) oblique perspective from above the
               North Pole, dist earth radii from center of earth,
               looking along the Date Line angle degrees off vertical
               trapezoidal(lat0,lat1) equally spaced parallels,
               straight meridians equally spaced along parallels, true
               scale at lat0 and lat1 on Prime Meridian

          Retroazimuthal projections.  At every point the angle
          between vertical and a straight line to `Mecca', latitude
          lat0 on the prime meridian, is the true bearing of Mecca.
               mecca(lat0) equally spaced vertical meridians
               homing(lat0) distances to `Mecca' are true

          Maps based on the spheroid.  Of geodetic quality, these pro-
          jections do not make sense for tilted orientations.  For
          descriptions, see corresponding maps above.
               sp_mercator()
               sp_albers(lat0,lat1)

     SEE ALSO
          map(7), map(5), plot(3)

     BUGS
          Only one projection and one orientation can be active at a
          time.
          The west-longitude-positive convention betrays Yankee chau-
          vinism.