bearing

fun bearing(start: Position, end: Position, final: Boolean = false): Double

Takes two positions (start, end) and finds the geographic bearing between them, i.e. the angle measured in degrees from the north line (0 degrees)

Return

bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)

Parameters

start

starting point

end

ending point

final

calculates the final bearing if true