Annotation of researchv10no/cmd/map/export/proj.3, revision 1.1.1.1

1.1       root        1: .TH PROJ 3X bowell
                      2: .CT 2 graphics math
                      3: .br
                      4: .SH NAME
                      5: orient, normalize \- map projections
                      6: .SH SYNOPSIS
                      7: .B orient(lat, lon, rot)
                      8: .br
                      9: .B double lat, lon, rot;
                     10: .PP
                     11: .B normalize(p)
                     12: .br
                     13: .B struct place *p;
                     14: .SH DESCRIPTION
                     15: Users of
                     16: .IR map (7)
                     17: may skip to the description of `Projection generators'
                     18: below.
                     19: .PP
                     20: The functions
                     21: .I orient
                     22: and
                     23: .I normalize
                     24: plus a collection of map projection generators
                     25: are loaded by
                     26: option
                     27: .BR -lmap 
                     28: of
                     29: .IR ld (1).
                     30: Most of them
                     31: calculate maps for a spherical earth.
                     32: Each map projection is available in one standard
                     33: form, into which data must be normalized
                     34: for transverse
                     35: or nonpolar projections.
                     36: .PP
                     37: Each standard projection is displayed with the Prime
                     38: Meridian (longitude 0) being a straight vertical line, along which North
                     39: is up.
                     40: The orientation of nonstandard projections is specified by
                     41: .I orient.
                     42: Imagine a transparent gridded sphere around the globe.
                     43: First turn the overlay about the North Pole
                     44: so that the Prime Meridian (longitude 0)
                     45: of the overlay coincides with meridian
                     46: .I lon
                     47: on the globe.
                     48: Then tilt the North Pole of the
                     49: overlay along its Prime Meridian to latitude
                     50: .I lat
                     51: on the globe.
                     52: Finally again turn the
                     53: overlay about its `North Pole' so
                     54: that its Prime Meridian coincides with the previous position
                     55: of (the overlay's) meridian
                     56: .I rot.
                     57: Project the desired map in
                     58: the standard form appropriate to the overlay, but presenting
                     59: information from the underlying globe.
                     60: It is not useful to use
                     61: .I orient
                     62: without using
                     63: .IR normalize .
                     64: .PP
                     65: .I Normalize
                     66: converts latitude-longitude coordinates on the globe
                     67: to coordinates on the overlaid grid.
                     68: The coordinates and their sines and cosines
                     69: are input to
                     70: .I normalize
                     71: in a
                     72: .B place
                     73: structure.
                     74: Transformed coordinates and their sines and cosines
                     75: are returned in the same structure.
                     76: .PP
                     77: .EX
                     78: .nr xx \w'12345678'
                     79: .ta \n(xxu +\n(xxu +\n(xxu +\n(xxu +\n(xxu +\n(xxu
                     80:        struct place {
                     81:                double radianlat, sinlat, coslat;
                     82:                double radianlon, sinlon, coslon;
                     83:        };
                     84: .EE
                     85: .PP
                     86: The projection generators
                     87: return a pointer to a function that converts normalized coordinates
                     88: to 
                     89: .I x-y
                     90: coordinates for the desired map, or
                     91: 0 if the required projection
                     92: is not available.
                     93: The returned function is exemplified by
                     94: .I proj 
                     95: in this example.  Warning: coordinates are in degrees for
                     96: .I orient,
                     97: in radians for
                     98: .LR place .
                     99: .PP
                    100: .EX
                    101: .ta \n(xxu +\n(xxu +\n(xxu +\n(xxu +\n(xxu +\n(xxu
                    102:        struct place pt;
                    103:        int (*proj)() = mercator();
                    104:        double x, y;
                    105: .EE
                    106: .PP
                    107: .EX
                    108:        orient(45.0, 30.0, 180.0);      /* set coordinate rotation */
                    109: .EE
                    110: .PP
                    111: .EX
                    112:        . . .                           /* fill in the pt structure */
                    113:        normalize(&pt);                 /* rotate coordinates */
                    114:        if((*proj)(&pt, &x, &y) > 0)    /* project onto x,y plane */
                    115:                plot(x, y);
                    116: .EE
                    117: .PP
                    118: The projection function
                    119: .B (*proj)()
                    120: returns 1 for a good point,
                    121: 0 for a point on a wrong
                    122: sheet (e.g. the back of the world in a perspective
                    123: projection), and \-1 for a point that is deemed
                    124: unplottable (e.g. points near the poles on a Mercator projection).
                    125: .PP
                    126: Scaling may be determined from the
                    127: .I x-y
                    128: coordinates of
                    129: selected points.
                    130: Latitudes and longitudes are measured in degrees for
                    131: ease of specification for
                    132: .I orient 
                    133: and the projection generators
                    134: but in radians for ease of calculation 
                    135: for
                    136: .I normalize
                    137: and
                    138: .I proj.
                    139: In either case
                    140: latitude is measured positive north of the equator,
                    141: and longitude positive west of Greenwich.
                    142: Radian longitude should be limited to the range
                    143: .if t .I \-\(*p\(<=lon<\(*p.
                    144: .if n .I -pi <= lon < pi.
                    145: .SS Projection generators
                    146: Equatorial projections centered on the Prime Meridian
                    147: (longitude 0).
                    148: Parallels are straight horizontal lines.
                    149: .br
                    150: .ns
                    151: .IP
                    152: .B mercator()
                    153: equally spaced straight meridians, conformal,
                    154: straight compass courses
                    155: .br
                    156: .B sinusoidal()
                    157: equally spaced parallels,
                    158: equal-area, same as
                    159: .I bonne(0)
                    160: .br
                    161: .B cylequalarea(lat0)
                    162: equally spaced straight meridians, equal-area,
                    163: true scale on
                    164: .I lat0
                    165: .br
                    166: .B cylindrical()
                    167: central projection on tangent cylinder
                    168: .br
                    169: .B rectangular(lat0)
                    170: equally spaced parallels, equally spaced straight meridians, true scale on
                    171: .I lat0
                    172: .br
                    173: .B gall(lat0)
                    174: parallels spaced stereographically on prime meridian, equally spaced straight
                    175: meridians, true scale on
                    176: .I lat0
                    177: .br
                    178: .B mollweide()
                    179: (homalographic) equal-area, hemisphere is a circle
                    180: .PP
                    181: Azimuthal projections centered on the North Pole.
                    182: Parallels are concentric circles.
                    183: Meridians are equally spaced radial lines.
                    184: .br
                    185: .ns
                    186: .IP
                    187: .B azequidistant()
                    188: equally spaced parallels,
                    189: true distances from pole
                    190: .br
                    191: .B azequalarea()
                    192: equal-area
                    193: .br
                    194: .B gnomonic()
                    195: central projection on tangent plane,
                    196: straight great circles
                    197: .br
                    198: .B perspective(dist)
                    199: viewed along earth's axis
                    200: .I dist
                    201: earth radii from center of earth
                    202: .br
                    203: .B orthographic()
                    204: viewed from infinity
                    205: .br
                    206: .B stereographic()
                    207: conformal, projected from opposite pole
                    208: .br
                    209: .B laue()
                    210: .IR radius " = tan(2\(mu" colatitude ),
                    211: used in xray crystallography
                    212: .br
                    213: .B fisheye(n)
                    214: stereographic seen from just inside medium with refractive index n
                    215: .br
                    216: .B newyorker(r)
                    217: .IR radius " = log(" colatitude / r ):
                    218: extreme `fisheye' view from pedestal of radius
                    219: .I r
                    220: degrees
                    221: .PP
                    222: Polar conic projections symmetric about the Prime Meridian.
                    223: Parallels are segments of concentric circles.
                    224: Except in the Bonne projection,
                    225: meridians are equally spaced radial
                    226: lines orthogonal to the parallels.
                    227: .br
                    228: .ns
                    229: .IP
                    230: .B conic(lat0)
                    231: central projection on cone tangent at
                    232: .I lat0
                    233: .br
                    234: .B simpleconic(lat0,lat1)
                    235: equally spaced parallels, true scale on
                    236: .I lat0
                    237: and
                    238: .I lat1
                    239: .br
                    240: .B lambert(lat0,lat1)
                    241: conformal, true scale on 
                    242: .I lat0
                    243: and 
                    244: .I lat1
                    245: .br
                    246: .B albers(lat0,lat1)
                    247: equal-area, true scale on
                    248: .I lat0
                    249: and 
                    250: .I lat1
                    251: .br
                    252: .B bonne(lat0)
                    253: equally spaced parallels, equal-area,
                    254: parallel
                    255: .I lat0
                    256: developed from tangent cone
                    257: .PP
                    258: Projections with bilateral symmetry about
                    259: the Prime Meridian
                    260: and the equator.
                    261: .br
                    262: .ns
                    263: .IP
                    264: .B polyconic()
                    265: parallels developed from tangent cones,
                    266: equally spaced along Prime Meridian
                    267: .br
                    268: .B aitoff()
                    269: equal-area projection of globe onto 2-to-1
                    270: ellipse, based on 
                    271: .I azequalarea
                    272: .br
                    273: .B lagrange()
                    274: conformal, maps whole sphere into a circle
                    275: .br
                    276: .B bicentric(lon0)
                    277: points plotted at true azimuth from two
                    278: centers on the equator at longitudes
                    279: .I \(+-lon0,
                    280: great circles are straight lines
                    281: (a stretched gnomonic projection)
                    282: .br
                    283: .B elliptic(lon0)
                    284: points are plotted at true distance from
                    285: two centers on the equator at longitudes
                    286: .I \(+-lon0
                    287: .br
                    288: .B globular()
                    289: hemisphere is circle,
                    290: circular arc meridians equally spaced on equator,
                    291: circular arc parallels equally spaced on 0- and 90-degree meridians
                    292: .br
                    293: .B vandergrinten()
                    294: sphere is circle,
                    295: meridians as in
                    296: .I globular,
                    297: circular arc parallels resemble 
                    298: .I mercator
                    299: .PP
                    300: Doubly periodic conformal projections.
                    301: .br
                    302: .ns
                    303: .IP
                    304: .B guyou()
                    305: W and E hemispheres are square
                    306: .br
                    307: .B square()
                    308: world is square with Poles
                    309: at diagonally opposite corners
                    310: .br
                    311: .B tetra()
                    312: map on tetrahedron with edge
                    313: tangent to Prime Meridian at S Pole,
                    314: unfolded into equilateral triangle
                    315: .br
                    316: .B hex()
                    317: world is hexagon centered
                    318: on N Pole, N and S hemispheres are equilateral
                    319: triangles
                    320: .PP
                    321: Miscellaneous projections.
                    322: .br
                    323: .ns
                    324: .IP
                    325: .B harrison(dist,angle)
                    326: oblique perspective from above the North Pole,
                    327: .I dist
                    328: earth radii from center of earth, looking
                    329: along the Date Line
                    330: .I angle
                    331: degrees off vertical
                    332: .br
                    333: .B trapezoidal(lat0,lat1)
                    334: equally spaced parallels,
                    335: straight meridians equally spaced along parallels,
                    336: true scale at
                    337: .I lat0
                    338: and
                    339: .I lat1
                    340: on Prime Meridian
                    341: .PP
                    342: Retroazimuthal projections.
                    343: At every point the angle between vertical and a straight line to
                    344: `Mecca', latitude
                    345: .I lat0
                    346: on the prime meridian,
                    347: is the true bearing of Mecca.
                    348: .br
                    349: .ns
                    350: .IP
                    351: .B mecca(lat0)
                    352: equally spaced vertical meridians
                    353: .br
                    354: .B homing(lat0)
                    355: distances to `Mecca' are true
                    356: .PP
                    357: Maps based on the spheroid.
                    358: Of geodetic quality, these projections do not make sense
                    359: for tilted orientations.
                    360: For descriptions, see corresponding maps above.
                    361: .br
                    362: .ns
                    363: .IP
                    364: .B sp_mercator()
                    365: .br
                    366: .B sp_albers(lat0,lat1)
                    367: .SH "SEE ALSO
                    368: .IR map (7), 
                    369: .IR map (5), 
                    370: .IR plot (3)
                    371: .SH BUGS
                    372: Only one projection and one orientation can be active at a time.
                    373: .br
                    374: The west-longitude-positive convention
                    375: betrays Yankee chauvinism.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.