Rewrite angular distance function to reduce the number of call to trigonometric functions
and use float instead of double.
Supress compilation warnings and cosmectic changes.