Issue #2: the azimuth function modified. Pending tests and documentation.