On the sphere x2+y2+z2=1, and on the octahedron |u|+|v|+|w|=1
The poles:
North and South, lat=90 and -90 degrees
Atlantic and Pacific, lng=0 and 180 at lat=0
East and West, lng=90 and -90 at lat=0
The unfolded maps of the octahedron: (cut on dotted lines)
E w: -1 : -1 0 : 0 0 : 0 0 : 0 z-like P ------ 1 ------ A 1 at North pole 0 : 0 -1 at South pole 0 : 0 0 on equator 0 : 0 -1 : -1 W E u: 0 : 0 0 : 0 - : + -1 : 1 x-like P ------ 0 ------ A 0 at N-S-E-W poles -1 : 1 1 at Atlantic pole - : + -1 at Pacific pole 0 : 0 0 : 0 W . E v: 0 : 0 1 : 1 + : + 0 : 0 y-like P ------ 0 ------ A 0 at N-S-A-P poles 0 : 0 1 at East pole - : - -1 at West pole -1 :-1 0 : 0 W
The equilateral triangles are deformed to right triangles in square data-arrays
z: S - - - - E - - - - S - - - - o + o - - - - - - - o + + + o - - - - - o + + + + + o - - - o + + + + + + + o - P + + + + N + + + + A - o + + + + + + + o - - - o + + + + + o - - - - - o + + + o - - - - - - - o + o - - - - S - - - - W - - - - S x: S o o o o E o o o o S - - - - - o + + + + + - - - - - o + + + + + - - - - - o + + + + + - - - - - o + + + + + P - - - - N + + + + A - - - - - o + + + + + - - - - - o + + + + + - - - - - o + + + + + - - - - - o + + + + + S o o o o W o o o o S y: S + + + + E + + + + S o + + + + + + + + + o o + + + + + + + + + o o + + + + + + + + + o o + + + + + + + + + o P o o o o N o o o o A o - - - - - - - - - o o - - - - - - - - - o o - - - - - - - - - o o - - - - - - - - - o S - - - - W - - - - S
Recap:
On the octahedron, |u|+|v|+|w|=1, nodes at the six poles have four equidistant neighbors (corners of a square). The "interior" nodes have six equidistant neighbors in a hexagonal array. The area elements are equilateral triangles, all with the same area.
On the sphere, x2+y2+z2=1, the maps of the nodes are given by x=x(u,v,w), y=y(u,v,w) and z=z(u,v,w), to be defined presently. The area elements are spherical triangles, and the mapping is to be chosen to make them all have approximately the same area.
In the data, the values of x,y,z and other vars are stored in square arrays, as outlined above.
Q: Is there an easy x(u...)... that is nearly uniform and easy to invert for u(x...)...? A: No.
Q: Is it better to specify the map x...(u...) or the inverse map u...(x...)? A: Depends, I guess.
It certainly is easier to place the nodes, u,v,w, on the faces, and then to compute the images x...(u...). The number N is the number of intervals along the edges of the eight faces of the octahedron. E.g. when N=7, each face has 36 nodes, counting edges. On the face beneath the first octant of the sphere, the homogeneous coordinates (u+v+w=1) are u=v=w=(0:N)/N and the nodes are situated as
w=1 * * * * * * v=0 * * * * u=0 N=7 * * * * * * * * * * * * * * * * * * * * * * * * * * u=1 w=0 v=1
A mapping to x,y,z that incorporates the symmetries of both the face and the octant is defined by the algorithm (from nodes.m)
% bta=1-B*(uv+vw+wu), and B is a parameter % x = 1-(1-bta*u)^pow for u = (0:N)/N % y = 1-(1-bta*v)^pow for v = (0:N)/N % z = 1-(1-bta*w)^pow for w = (0:N)/N % then (x,y,z) = (x,y,z)/sqrt(x^2+y^2+z^2)
The choice B=0 and pow=1.55 does a pretty decent job of distributing the nodes uniformly on the sphere. The result is an easy evaluation of x...(u...), but the inverse, u...(x...), is defined implicitly.
For numerical algorithms that use characteristics and/or particle paths it is more convenient to have a direct and simple algorithm for evaluations of u...(x...). For that case (from nvrtrf.m)
% An approximate two-param inverse x,y,z => u,v,w is: % % bu=1-(1-alf*x)^q x^2+y^2+z^2 = 1 % bv=1-(1-alf*y)^q where q=1/pow % bw=1-(1-alf*z)^q alf = (x+y+z)-A*(xy+yz+zx) % % uvw=bu+bv+bw and u=bu/uvw, v=bv/uvw, w=bw/uvw % % What we do: given (u,v,w) with u+v+w=1, % use Newton's method to find the (x,y,z) % s.t. x,y,z is mapped to u,v,w % % if not specified, pow is 1.55 (try 0.33) % if not specified, A is 1 (not bad for pow in (1,2)) % if not specified, tol is 1e-4 (max of |du|,|dv|,|dw|)
On the principal face (positive coordinates) nodes are the desired ones at the corners of equilateral triangles, and there are three reflections (u,v to v,u ...) that define six isomorphic sets of nodes. nvrtrf() does the Newton's method for one set and then fills in eleven others by symmetry operations. setup() then extends results to the other three quadrants. It was a gain of approximately 48 to 1 - who could have resisted?
The separation of physical nodes is near 10K/N kilometers. For N=90 the separations of the 32442 distinct nodes in the arrays of 32761 are approximately 111 km.
Implementations (MATLAB):
setup:
global vars are:
N: number of intervals per edge x,y,z: positions on the sphere pow: mapping parameter for nvrtrf() topo: one-degree topographic map cmap: colormap for show()
show(lat,lng,[dst] ):
rotz( [fig] ): rotz.m sets it all in motion.
An example:
glob3.gif