Q:How is the slope and relative slope calculated in NaviModel Producer?

A:Slope and relative slope are calculated as explained below:


Slope:

 

Calculated as the angle between cell normal and an up vector. Slope is calculated by looking at neighbour cells. 4 neighbours are considered: W, E, S and N. A terrain normal is calculated, and then the slope of the terrain is calculated as the angle between this vector and an up vector.

 

Terrain normal vector is calculated as

x = ze-zw

y = zn-zs

z = 2 * cellsize

 

Where ze, zw, zn and zs is the z of neighbour cells.

 

Relative slope:


Calculated as the angle between cell normal and the average normal of surrounding cells.

Cell normal is calculated as described above. The average normal of surrounding cells is calculated as the average of normal 3 cells away.