#!/bin/rc

fn demo {proj=$1;	shift;
	label=$1;	shift;
	{	echo 'o'
		echo 'ra -8192 -8492 8192 8492'
		echo 'e'
		echo 'm -8192 8192'
		echo t $type
		echo 'm -8192 -8192'
		echo t $proj - $label
		MAP=world MAPDIR=/lib/map map $proj $* -s -d 5
	} | plot
}

rfork en
type='Equatorial projections are centered on centered on long. 0, parallels are straight lines'

demo mercator 'equally spaced straight meridians, conformal, straight compass courses'
demo sinusoidal 'equally spaced parallels, equal-area, same as bonne(0)'
demo cylequalarea 'equally spaced straight meridians, equal-area, true scale on Eq' 0
demo rectangular 'equally spaced parallels, equally spaced straight meridians, true scale on Eq' 0
demo gall 'parallels spaced stereographically on prime meridian, equally spaced straight meridians, true scale on Eq' 0
demo mollweide '(homalographic) equal-area, hemisphere is a circle'

type='Azimuthal: centered on the North Pole, Parallels are concentric circles, Meridians are equally spaced radial lines'

demo azequidistant 'equally spaced parallels, true distances from pole'
demo azequalarea 'equal area'
demo perspective 'viewed along earth''s axis 2 earth radii from center of earth' 2
demo orthographic 'viewed from infinity'
demo stereographic 'conformal, projected from opposite pole'
demo laue 'radius = tan(2\(mu colatitude ), used in xray crystallography'
demo fisheye 'Fisheye map with index of refraction on 0.5' 0.5 -o 40.75 74
demo newyorker 'New Yorker map from viewing pedestal of radius .5' .5 -o 40.75 74

type='Polar conic projections symmetric about the Prime Meridian. Parallels are segments of concentric circles.'

demo conic 'central projection on cone tangent at 40' 40
demo simpleconic 'equally spaced parallels, true scale on 20 and 50' 20 50
demo lambert 'conformal, true scale on 20 and 50' 20 50
demo albers 'equal-area, true scale on 20 and 50' 20 50
demo bonne 'equally spaced parallels, equal-area, parallel 40 developed from tangent cone' 40

type='Projections with bilateral symmetry about the Prime Meridian and the equator.'

demo polyconic 'parallels developed from tangent cones, equally spaced along Prime Meridian'
demo aitoff 'equal-area projection of globe onto 2-to-1 ellipse, based on azequalarea'
demo lagrange 'conformal, maps whole sphere into a circle'
demo bicentric 'points plotted at true azimuth from two centers on the equator at longitudes +-40, great circles are straight lines' 40
sleep 3
demo elliptic 'points are plotted at true distance from two centers on the equator at longitudes +-40' 40
demo globular 'hemisphere is circle'
demo vandergrinten 'sphere is circle, meridians as in globular, circular arc parallels resemble mercator'

type='Doubly periodic conformal projections.'

demo guyou 'W and E hemispheres are square'
demo square 'World is square with Poles at diagonally opposite corners'
demo tetra 'map on tetrahedron with edge tangent to Prime Meridian at S Pole, unfolded into equilateral triangle'
demo hex 'world is hexagon centered on N Pole, N and S hemispheres are equilateral
triangles'

type='Miscellaneous projections.'

demo harrison 'oblique perspective from above the North Pole, 2 earth radii from the earth, looking along the Date Line 40 degrees off vertical' 2 40
sleep 3
demo trapezoidal 'equally spaced parallels, straight meridians equally spaced along parallels, true scale at 20 and 50 on Prime Meridian' 20 50

type='Retroazimuthal projections.'

demo mecca 'equally spaced vertical meridians' 21.4 -o 90 -39.8
demo homing 'distances to ''Mecca'' are true' 21.4 -o 90 -39.8

type='Maps based on the spheroid'

demo sp_mercator 'equally spaced straight meridians, conformal'
demo sp_albers 'equal-area, true scale on 20 and 50' 20 50