The intensity of each ray is computed by solving for a set of four variables called the Stokes parameters. Because the rays represent electromagnetic waves, in general it is often necessary to store information about the direction of the electromagnetic field vector, not just its amplitude, and the Stokes parameters accomplish this with ease.