八方位陰影圖分析是參考ArcGIS網站上所提供之演算法,如下:
(1) Hillshade=255.0*((cos(Zenith_rad)*cos(Slope_rad))+ (sin(Zenith_rad) * sin(Slope_rad) * cos(Azimuth_rad - Aspect_rad)))
(2) Zenith_deg = 90 – Altitude, 其中Altitude=45 (default)
Convert to radians:(3) Zenith_rad = Zenith_deg * pi / 180.0
(4) Azimuth_math = 360.0 - Azimuth + 90, 其中Azimuth=315(default)
Note that if Azimuth_math >= 360.0, then:(5) Azimuth_math = Azimuth_math - 360.0
Convert to radians:(6) Azimuth_rad = Azimuth_math * pi / 180.0
(7) [dz/dx] = ((c + 2f + i) - (a + 2d + g)) / (8 * cellsize)
The rate of change in the y direction for cell 'e' is calculated with the following algorithm:(8) [dz/dy] = ((g + 2h + i) - (a + 2b + c)) / (8 * cellsize)
The steepest downhill descent from each cell in the surface is the slope. The algorithm for calculating the slope in radians, incorporating the z-factor, is:(9) Slope_rad = ATAN (z_factor * SQRT([dz/dx]2+ [dz/dy]2))
(10) The direction the steepest downslope direction is facing is the aspect. Aspect in radians is defined in the range of 0 to 2pi, with 0 toward east. The aspect is determined under the rules in the following algorithm:
If [dz/dx] is non-zero:
Aspect_rad = atan2 ([dz/dy], -[dz/dx])
if Aspect_rad < 0 then
Aspect_rad = 2 * pi + Aspect_rad
If [dz/dx] is zero:
if [dz/dy] > 0 then
Aspect_rad = pi / 2
else if [dz/dy] < 0 then
Aspect_rad = 2 * pi - pi / 2
else
Aspect_rad = Aspect_rad