Useful angle and distance related functions