ATIS v0.4.0

ATIS
UTILS
AIRBASE
This commit is contained in:
Frank
2019-10-09 21:13:08 +02:00
parent c0e48288de
commit dc9f730d7d
3 changed files with 357 additions and 91 deletions

View File

@@ -872,6 +872,23 @@ function UTILS.VecHdg(a)
return h
end
--- Calculate the difference between two "heading", i.e. angles in [0,360) deg.
-- @param #number h1 Heading one.
-- @param #number h2 Heading two.
-- @return #number Heading difference in degrees.
function UTILS.HdgDiff(h1, h2)
-- Angle in rad.
local alpha=math.rad(h1)
local beta=math.rad(h2)
-- Runway vector.
local v1={x=math.cos(alpha), y=0, z=math.sin(alpha)}
local v2={x=math.cos(beta), y=0, z=math.sin(beta)}
return math.abs(UTILS.VecAngle(v1, v2))
end
--- Rotate 3D vector in the 2D (x,z) plane. y-component (usually altitude) unchanged.
-- @param DCS#Vec3 a Vector in 3D with x, y, z components.