The measurement of astigmatic lenses, optical surfaces or wavefronts are a highly studied problem and many different instruments have been commercially fabricated to perform this task. Many of them use a Hartmann arrangement to obtain the result. In this paper, we analyze with detail the algorithms that can be used to make the necessary calculations and propose several alternatives with different advantages and disadvantages. Different mathematical algorithms that are involved in the calculation process have been given whereas any description of the instrument itself is not proposed, but only the different mathematical algorithms that are involved in the calculation process.