Computation of Slope: Alineina3Dspace
Computation of Slope: Alineina3Dspace
Computation of Slope: Alineina3Dspace
(1)
In addition, the azimuth of the line AB, or its orientation angle measured clockwise from North,
is given by
(2)
Example
The location of two survey benchmarks on 24th St on the University of Texas campus is shown
in Figure 2, and Figure 3 shows a photograph of Benchmark B which is located on a bridge over
Waller Creek. These benchmarks serve as reference points for the location of campus facilities.
The coordinates of these two benchmarks with all dimensions in feet are given by
Benchmark
A
B
Easting
819470.95
820462.32
Northing
235256.11
235187.15
Elevation
555.42
524.06
Solution
In the coordinate values, the Easting is x, Northing is y, and Elevation is z, so the x-component
of the vector AB is given by x = 820462.32 - 819470.95 = 991.37, and similar computations for
y and z produce the following values in feet:
AB
x
991.37
y
-68.96
z
-31.36
Notice that while x is positive meaning that B is East of A, y is negative meaning that B is
slightly South of A, and z is also negative because B is below A, and in fact water flows down
24th St from A to B as it drains towards Waller Creek on our campus.
The Length of the line AB is given by
=
For the line AB, the rise = -31.36 ft, and the run = 991.37 + (68.96) = 993.77 ft, and
substituting these quantities into Eq. (1),
Slope =
or,
31.36
993.77
Slope = 0.0316
3
This means that the average downhill slope of 24th St as water drains along it towards Waller
Creek is a little more than 3%. Another way of expressing the slope is as an angle in degrees,
called the zenith, which may be computed as
Zenith =
or,
180
tan (0.0316)
Zenith = 1.807
180
tan
x
y
However, the computation of the azimuth is more complicated mathematically than for the zenith
because the inverse tangent function is multi-valued. This does not matter for the zenith angle
which is limited to the range -90 to 90 . However for the azimuth angle which has the range
0 to 360 , this multi-valuedness is an issue because the ratio x/y is the same as the ratio
(x)/(y), but vectors (x, y) and (x, y) are in opposite directions. The atan2
function has been developed to resolve this ambiguity. In Excel the atan2 function is defined as
follows: atan2(x_num,y_num) returns the arctangent, or inverse tangent, of the specified x- and
y-coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0)
and a point with coordinates (x_num, y_num). The angle is given in radians between -pi and pi,
excluding pi. Note that computer programming languages commonly define atan2 differently,
with the arguments reversed from Excel, so in using this function you need to check on the
convention used. Wikipedia provides a thorough discussion
(http://en.wikipedia.org/wiki/Atan2).
In this instance, we have
Azimuth =
atan2 (y, x) =
between and , so here with 180/ as a pre-multiplier the range is -180o to 180o. In case a
negative value is obtained add 360o to obtain the corresponding angle clockwise from North.
So, in summary, there several ways that we can think about the definition of the line AB:
A vector that originates at point A, and has components in the (x,y,z) Cartesian coordinate space
of (991.37, -68.96, -31.36).
A vector of length 994.26 ft that originates at A, which is rotated 93.98 from North in the
horizontal plane, and then 1.81 in the vertical plane to reach the point B. The values (994.26,
93.98, -1.81) are its coordinates in a Spherical coordinate space.
A vector drawn in the azimuth direction of 93.98 that has a horizontal component or run of
991.37 ft and a vertical component or rise of -31.36 ft.
In all these instances, it takes three pieces of information to define the line that originates at point
A and ends at point B in a 3D space, in the first instance three length values, in the second
instance one length value and two angles, and in the third instance two length values and one
angle. These are all valid ways of thinking about how vectors are defined in a 3D space, but the
third one is the most useful for defining the slope of the line.
A Function in a 2D Space
Suppose we have a 2D space (x,y) where x and y are coordinates in the horizontal plane, and we
have some arbitrary function F defined over this plane. The value of F could represent any scalar
quantity, such as annual precipitation or air temperature. If we wish to define the gradient of
this function at a particular location (x,y), we would use the nomenclature:
F(x, y) =
F F
,
x y
|F(x, y)| =
F
y
F F
,
x y
Z Z
,
x y
Z
x
Z
y
To make this computation meaningful, Z needs to be defined in the same length units as x and y,
and the result is a dimensionless quantity that represents the slope with positive being upwards.
When multiplied by 100, this becomes the percent rise value arising from the slope function in
the ArcGIS software. A computation corresponding to that for the zenith angle described earlier
gives the slope angle in degrees in the ArcGIS Slope function.
In physical geography, the orientation of the land surface is defined by its aspect, which is
analogous to the azimuth used in land surveying. For example, we might describe mountainside
as having a Westerly aspect if the ridge at its crest lies in the North-South direction, and the land
sloping down from that on one side, faces towards the West (and correspondingly an Easterly
aspect on the other side of the ridge). By analogy with the azimuth, the ArcGIS aspect function
evaluates aspect as:
Aspect = atan2
Z Z
,
y x
Aspect identifies the downslope direction so the partial derivatives in this equation need to be
evaluated as positive downslope. ArcGIS uses finite difference approximations for these partial
derivatives
z (a + 2d + g) - (c + 2f + i)
x
8 * x_mesh_spacing
z (g + 2h + i) - (a + 2b + c)
y
8 * y_mesh_spacing
The basis for this is illustrated in Figure 6 and amounts to an average of central finite differences
over each of the three rows of cells with the middle row counting twice as it appears in averages
on each side.
Drop
Run
Where drop refers to the difference in elevation between the from cell and the to cell, with
downwards considered positive, and the run is equal to the cell size for flow along the coordinate
directions, and equal to 2 x cell size for flow in the diagonal directions. So, in effect, the D8
flow direction is a slope computation on a set of eight 3D lines like the lines connecting the
survey benchmarks in the example described above, where the one giving the maximum
downward slope is selected as the direction of steepest descent and its corresponding value (1, 2,
4,., 64, 128) is encoded in the flow direction grid.
Slope of a River
Suppose we have a river defined on a map as a sequence of stream segments, and we wish to
calculate the slope of the river. The picture below shows the Logan River and basin above
Logan, Utah, and a digital elevation model of the area. The length of the river is found by
adding up the length of each of its segments.
In this case the river segments come from the NHDPlus dataset, and these have a LengthKm
attribute on them, so the length of the river itself can be found by summing this attribute to yield
a result of Length = 53.917 km.
A simple way to compute the slope of the river is to dissolve all the stream segments into a
single feature for the river, and use the function ZonalStats as Table to find the minimum and
maximum elevations that lie under that feature. For the Logan River, this results in the table:
8
Thus, the maximum elevation is 2466.49m and minimum elevation is 1425.81m, so the elevation
difference is 1040.68m, and the slope of the river is 1040.68/53917 m/m = 0.0193 or 1.93%.
This is an elaborate version of the point to point calculation of slope described earlier where now
the length of the line is along a river rather than simply being a geometrically straight line.
Now, it could occur that the slope of the river changes as you go down the river (steeper in the
headwaters, and flatter downstream). One way to allow for this is to compute a weighted
average of slope, Si, of each stream segment, where the weights are the lengths of the stream
segments, Li. The FlowLineAttributes flow table of NHDPlus has a Slope attribute, so the
overall river slope SR, is computed as:
=
In the case of the Logan river, this computation yields SR = 1.0589/53.917 = 0.01964, or 1.96%,
almost the same as the previous result. Here is a picture of the slopes of some individual stream
segments: