bearing function

Bearing calculations