usage: require("utils")
this library contains several methods that serve to simplify programming

methods:

            --Please note that this code does not implement radar rotation, so the angle is limited to 180 degrees.
--also, the utils.radarTriangulation function currently provides triangulation functionality only for radars standing on a horizontal plane
                
local utils = require("utils")

local radar = getComponent("radar")
local gps = getComponent("gps")

radar.setAngle(math.rad(0))
radar.setVFov(math.rad(180))
radar.setHFov(math.rad(180))

function callback_loop()
    local gpsdata = gps.getSelfGpsData()
    local pos = gpsdata.position
    local angle = -gpsdata.rotationEuler.z

    print("----------")
    for i, target in ipairs(radar.getTargets()) do
        local pos = utils.radarTriangulation(target, pos, angle)
        print(i .. ". " .. utils.roundTo(pos.x, 1) .. " : " .. utils.roundTo(pos.y, 1) .. " : " .. utils.roundTo(pos.z, 1))
    end
end