From 3b1b57a33e128975a9cf6946a6bf9dbd33d148cf Mon Sep 17 00:00:00 2001 From: Frank Date: Thu, 16 Feb 2023 17:20:53 +0100 Subject: [PATCH] Update Positionable.lua - Added GetGroundSpeed --- .../Moose/Wrapper/Positionable.lua | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index f47d888d8..082977785 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -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.