Skip to content

Commit

Permalink
Update Positionable.lua
Browse files Browse the repository at this point in the history
- Added GetGroundSpeed
  • Loading branch information
funkyfranky committed Feb 16, 2023
1 parent f85c032 commit 3b1b57a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Moose Development/Moose/Wrapper/Positionable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3b1b57a

Please sign in to comment.