The angle between the surface normal and the incoming light ray is called the angle of incidence and we can express a intensity of the light in terms of this angle.
In practice we use vector analysis to compute cosine term indirectly. If both the normal vector and the incoming light vector are normalized (unit length) then diffuse shading can be computed as follows: