mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
xx
This commit is contained in:
parent
203f0c8abc
commit
538e35d8f0
@ -968,8 +968,10 @@ do -- COORDINATE
|
||||
-- @return DCS#Distance Distance The distance in meters.
|
||||
function COORDINATE:Get2DDistance(TargetCoordinate)
|
||||
if not TargetCoordinate then return 1000000 end
|
||||
local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z}
|
||||
local norm=UTILS.VecNorm(a)
|
||||
--local a={x=TargetCoordinate.x-self.x, y=0, z=TargetCoordinate.z-self.z}
|
||||
local a = self:GetVec2()
|
||||
local b = TargetCoordinate:GetVec2()
|
||||
local norm=UTILS.VecDist2D(a,b)
|
||||
return norm
|
||||
end
|
||||
|
||||
@ -1329,13 +1331,16 @@ do -- COORDINATE
|
||||
-- @param Core.Settings#SETTINGS Settings
|
||||
-- @param #string Language (Optional) Language "en" or "ru"
|
||||
-- @param #boolean MagVar If true, also state angle in magnetic
|
||||
-- @param #number Precision Rounding precision, defaults to 0
|
||||
-- @return #string The BR Text
|
||||
function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar )
|
||||
function COORDINATE:GetBRText( AngleRadians, Distance, Settings, Language, MagVar, Precision )
|
||||
|
||||
local Settings = Settings or _SETTINGS -- Core.Settings#SETTINGS
|
||||
|
||||
|
||||
Precision = Precision or 0
|
||||
|
||||
local BearingText = self:GetBearingText( AngleRadians, 0, Settings, MagVar )
|
||||
local DistanceText = self:GetDistanceText( Distance, Settings, Language, 0 )
|
||||
local DistanceText = self:GetDistanceText( Distance, Settings, Language, Precision )
|
||||
|
||||
local BRText = BearingText .. DistanceText
|
||||
|
||||
@ -2909,12 +2914,13 @@ do -- COORDINATE
|
||||
-- @param #COORDINATE FromCoordinate The coordinate to measure the distance and the bearing from.
|
||||
-- @param Core.Settings#SETTINGS Settings (optional) The settings. Can be nil, and in this case the default settings are used. If you want to specify your own settings, use the _SETTINGS object.
|
||||
-- @param #boolean MagVar If true, also get angle in MagVar for BR/BRA
|
||||
-- @param #number Precision Rounding precision, currently full km as default (=0)
|
||||
-- @return #string The BR text.
|
||||
function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar )
|
||||
function COORDINATE:ToStringBR( FromCoordinate, Settings, MagVar, Precision )
|
||||
local DirectionVec3 = FromCoordinate:GetDirectionVec3( self )
|
||||
local AngleRadians = self:GetAngleRadians( DirectionVec3 )
|
||||
local Distance = self:Get2DDistance( FromCoordinate )
|
||||
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar )
|
||||
return "BR, " .. self:GetBRText( AngleRadians, Distance, Settings, nil, MagVar, Precision )
|
||||
end
|
||||
|
||||
--- Return a BRA string from a COORDINATE to the COORDINATE.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user