component to calculate angle between two coordinates