303
SLOPE, ASPECT, AND HILL SHADED MAPS
Several important DEMGS display procedures are based on
angular properties of a plane tangent to the topographic
surface. Surface slope or gradient is the angle between
the surface tangent and the horizontal. Surface aspect is
the direction, in angular measurement from some zero-point
(typically north), of the direction of steepest slope.
Analytical hill shading is based primarily upon the angle
between an orthogonal to the surface and a vector pointing
toward a "light source." DEMGS computes these rapidly on
the basis of simple linear algebra operations.
Since in DEMGS, topography is represented by a rectangular
regular grid, the orthogonal to the surface at a grid cell
could be defined in several ways. For rapid processing, the
system assumes that this orthogonal is adequately represent
ed by the orthogonal to one of the four adjacent right tri
angles: the triangle to the "northeast" was selected arbi
trarily (see figure 3).
The cross product of two vectors produces a third vector
which is orthogonal to the first two. The length of the
cross-product vector is twice the area of the triangle
formed by them, and the sign (direction) is given by the
"right-hand rule." Since in the present application, an
upward vector is desired, the vectors are multiplied in
counter-clockwise order p x q (figure 3). Using the grid
coordinate system, the vector p has components (dX,0,Zl-20)
and q has components (0,dY,Z2-Z0), where Z0= Z(I,FIRST),
Zl = Z(I,SECOND), Z2 = Z(1-1,FIRST), dX is the grid spacing
in the X direction, and dY is the grid spacing in the Y
direction. If the vector p is denoted by (Xp,Yp,Zp), and
q by (Xq,Yq,Zq) then the orthogonal vector v which is
(Xv,Yv,Zv) is defined by;
Xv = YpZq - YqZp (3a)
Yv = XqZp - XpZq (3b)
and Zv = XpYq - XqYp (3c)
since Xq = Yp = 0, several terms vanish.
Substituting gives
Xv = -dY (Zl - Z0) (4a)
Yv = -dX (Z2 - Z0) (4b)
Zv = dXdY (4c)
Note that since dX and dY are in the current case constant
for an entire model, all orthogonal vectors have the same
z component, which can be computed outside the loop. A
unit orthogonal vector u can be obtained by dividing each
component by the vector length.
Slope Map (DSLQPE)
The slope angle between the surface tangent and the horizon
tal is the same as the angle between the orthogonal vector
and the vertical. Furthermore, note that the z-component
of the unit orthogonal vector, Zu = Zv/L, is just the
cosine of zero. The slope angle in radians is obtained by