WEAPON v0.1.0

**WEAPON**
- Improments of class
- ARTY works
- FOX works
- RANGE should work, not tested.
This commit is contained in:
Frank
2023-02-04 23:28:45 +01:00
parent 4b4708e2a8
commit 6d967358da
7 changed files with 462 additions and 236 deletions

View File

@@ -1197,6 +1197,20 @@ function UTILS.HdgDiff(h1, h2)
return math.abs(delta)
end
--- Returns the heading from one vec3 to another vec3.
-- @param DCS#Vec3 a From vec3.
-- @param DCS#Vec3 b To vec3.
-- @return #number Heading in degrees.
function UTILS.HdgTo(a, b)
local dz=b.z-a.z
local dx=b.x-a.x
local heading=math.deg(math.atan2(dz, dx))
if heading < 0 then
heading = 360 + heading
end
return heading
end
--- Translate 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.