# QuestionVTOL info? (specifically direction)

#### dmurley

##### New member
As I approach a VTOL pad I would like to be able to obtain information (via Lua) on the pad's bearing and distance.

Distance is not a problem: range = oapi.get_navrange(hNav)

I don't see anything that will give me a bearing. Am I missing something?

Thanks.

#### dgatsoulis

##### ele2png user
One way to do it is to get the pad's global position with oapi.get_navpos, convert to equatorial coords with oapi.global_to_equ and calculate the target's bearing relative to your ship's equ coordinates.

Code:
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ )
where	φ1,λ1 is the start point, φ2,λ2 the end point (Δλ is the difference in longitude)

Several useful long/lat calculations here.

I think that there must be a more elegant way to do this, but the method above does work.