Update Positionable.lua

- Added GetGroundSpeed
This commit is contained in:
Frank 2023-02-16 17:20:53 +01:00
parent f85c0320ec
commit 3b1b57a33e

View File

@ -897,6 +897,26 @@ function POSITIONABLE:GetAirspeedIndicated(oatcorr)
return ias
end
--- Returns the horizonal speed relative to eath's surface. The vertical component of the velocity vector is projected out (set to zero).
-- @param #POSITIONABLE self
-- @return #number Ground speed in m/s. Returns 0 if the POSITIONABLE does not exist.
function POSITIONABLE:GetGroundSpeed()
local gs=0
local vel=self:GetVelocityVec3()
if vel then
local vec2={x=vel.x, y=vel.z}
gs=UTILS.Vec2Norm(vel)
end
return gs
end
--- Returns the Angle of Attack of a POSITIONABLE.
-- @param #POSITIONABLE self
-- @return #number Angle of attack in degrees.