ANG

Angle of incidence from elevation


EnvironmentsPYTHON :: EASI :: MODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Algorithm :: Related

Back to top

Description


Calculates the angle of incidence between a user-selected point light source and the surface normal for each point on a surface. The output image contains angles ranging from 0 to 90 degrees.
Back to top

Parameters


Name Type Length Value range
Input: Input elevation channel or layer * Raster port 1 - 1  
Output: Output layer Raster port 0 - 1  
Pixel X Size Float 0 - 2 0.0 -
Default: 30
Pixel Y Size Float 0 - 2 0.0 -
Default: 30
Elevation Step Float 0 - 1 Default: 1
Aang Real 3 - 3 0.0 - 360.0
Default: 45.0
Eang Real 3 - 3 0.0 - 90.0
Default: 45.0
Distance * Real 3 - 3 0.0 -

* Required parameter
Back to top

Parameter descriptions

Input: Input elevation channel or layer

Specifies the input channel or layer that contains the elevation data.

Output: Output layer

Specifies the output layer that will receive the Angle of Incidence image.

Pixel X Size

Specifies, in meters, the x-dimension of one pixel on the ground. If the dimension is not specified, ANG uses the pixel size stored in the database header. Correct calculation of the angle of incidence depends on proper specification of this value.

Pixel Y Size

Specifies, in meters, the y-dimension of one pixel on the ground. If the dimension is not specified, ANG uses the pixel size stored in the database header. Correct calculation of the angle of incidence depends on proper specification of this value.

Elevation Step

Specifies, in meters, the elevation corresponding to one gray level. A change of 1 gray level in the elevation image corresponds to a change in elevation of ELSZ (Elevation Step) meters. Correct calculation of the angle of incidence depends on proper specification of this value.

Aang

Specifies the azimuth angle to the point light source, relative to the top-left corner of the image.

Eang

Specifies the azimuth elevation angle to the point light source, relative to the top-left corner of the image.

Distance

Specifies the azimuth distance, in kilometers, to the point light source, relative to the top-left corner of the image.

When the illumination source is solar, the variation in sun-to-earth distance in most applications of ANG is insignificant, so a nominal or average distance value can often be used; for example, 9 290 000 miles or 149 476 000 km.

When the illumination source is non-solar, the angle between a ray from a point source and the surface normal can vary over the ground extent of a DEM even if the surface is perfectly flat. The range of this angle variation for a given ground extent decreases as the distance between the point source and the surface increases.

Back to top

Details

ANG uses a specified elevation channel as input to calculate incidence angles between a user-selected point light source and the surface normal for each pixel of the input channel. The output image contains angles, which range from 0 to 90 degrees.

Assuming a line is drawn connecting the point source to the top-left pixel of the image, the azimuth angle is the azimuth of the line in degrees clockwise from north (top of the image); the elevation angle is the elevation of the line in degrees from the horizontal; the distance is the length of this line in kilometers; that is, the distance from a zero elevation point at the top-left corner of the image (0,0) to the point source.

Correct calculation of incidence angles is dependent on the proper specification of ELSZ (Elevation Step Size) and PXSZ (Pixel X Size, Pixel Y Size). If unspecified, ELSZ is set equal to one. If PXSZ is not specified, ANG uses the pixel size stored in the database header.

The angle of incidence at a point is calculated as the angle between a point on the surface and the line connecting this point to the point light source. Output angle values will be in the range of 0 to 90 degrees. See the Algorithm section for more information.

Back to top

Algorithm

LSRC, PXSZ, and ELSZ are user-defined parameters.

Light Source Location, Pixel Ground Size, and Elevation Step Size are user-defined parameters.

Convert the azimuth angle, elevation angle, and distance values to a cartesian coordinate position (lx,ly,lz) in meters.

lx =  sin(azimuth angle) * cos(elevation angle) * distance*1000
ly = -cos(azimuth angle) * cos(elevation angle) * distance*1000
lz =  sin(elevation angle) * distance*1000

For each pixel p = (px,py,pz), define px,py as the pixel/row location and pz as the elevation. The immediate neighbors of p are a,b,c,and d, where a=(px,py-1,az), b=(px-1,py,bz), etc.

                . a .
                b p c
                . d .
Calculate the angle of incidence as follows:
  1. Define two vectors, V1 and V2, across the pixel in question:

       V1 = (dx,0,dzx) = (2*PXSZ(1),0,(bz-cz)*ELSZ)   (left to right)
       V2 = (0,dy,dzy) = (0,2*PXSZ(2),(az-dz)*ELSZ)   (top to bottom)
    

    where dzx and dzy are the elevation changes between pixels, and dx and dy are the projected distances between pixels. PXSZ and ELSZ are user-specified parameters giving pixel ground size and elevation sizes. dx and dy will be twice the actual pixel ground size because the elevation differences (or gradients) are taken over 2-pixel distances.

  2. Find the normal vector to the plane formed by the two vectors V1 and V2, by taking the cross product:

        N = V1 X V2 = (-dy*dzx, -dx*dzy, dx*dy) = (nx, ny, nz).
    
  3. Find the vector connecting the current pixel p with the point light source by subtracting the coordinates of the pixel (shifted so that the top left corner (1,1) has the co-ordinates (0,0)) from the light source vector:

        (rlx,rly,rlz) =
            (lx,ly,lz) - ((px+2)*PXSZ(1), (py+2)*PXSZ(2), pz*ELSZ)
    
  4. The cosine of the angle between two vectors is the dot product of the vectors divided by the sum of their magnitudes:

    cos(ang) = (nx*rlx + ny*rly + nz*rlz) /                  
        (sqrt(nx**2+ny**2+nz**2)*sqrt(rlx**2+rly**2+rlz**2))
    
  5. The angle that the vector from the light source forms with the surface will be the complement of the angle that it forms with the normal vector, calculated by taking the arcsin of cosine of the angle with the normal vector, as calculated in step 4. Any values outside the range 0 to 90 (indicating that light will not strike the surface) are set to 0.

         POINT LIGHT *) 
           SOURCE      \               
                        \              i = local incidence angle   
                         \ 
                          \         
                           \       
                            \     
                             \ 
                            i \ 
                 +------------------------+
                           SURFACE
    

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.