result = horizontan(dem, viewAngle)
directional; spatial, non-spatial
To determine whether a cell receives direct radiation, a critical angle for each cell is required.
When the solar angle is larger than the critical angle, the cell receives direct solar radiation.
This function calculates the maximum tangent of the angles of neighbouring cells in the direction of the sun (
viewAngle, the solar azimuth).
Since the function can only be executed if there are neighbouring cells, no value can be given to cells at the edge of the
They become missing values.