как в этот код добавить измерения скорости цели local radarRadius = 48
local scanAngle = 0
local targetHoldTime = 150
local minDisplayDistance = 20
local targets = {


    {distanceIndex = 1, azimuthIndex = 2},
    {distanceIndex = 5, azimuthIndex = 6},
    {distanceIndex = 9, azimuthIndex = 10}
}

for _, target in ipairs(targets) do
    target.color = {0, 255, 0}
    target.visible = false
    target.timer = 0
    target.x = 0
    target.y = 0
end

function onTick()

    maxRadarRange = input.getNumber(7)
    scanAngle = (input.getNumber(4) % 1) * 360 - 90

    for _, target in ipairs(targets) do
        local distance = input.getNumber(target.distanceIndex)
        local azimuth = input.getNumber(target.azimuthIndex)

        if distance > minDisplayDistance and target.timer == 0 then
            local effectiveAzimuth = (azimuth + scanAngle) % 360
            local distanceRatio = distance / maxRadarRange
            target.x = 48 + radarRadius * distanceRatio * math.cos(math.rad(effectiveAzimuth))
            target.y = 48 + radarRadius * distanceRatio * math.sin(math.rad(effectiveAzimuth))
            target.x = math.min(math.max(target.x, 0), 96)
            target.y = math.min(math.max(target.y, 0), 96)
            target.visible = true
            target.timer = targetHoldTime
        elseif target.timer > 0 then
            target.timer = target.timer - 1
            if target.timer == 0 then
                target.visible = false
            end
        end
    end
end

function drawRadarBeam(angle, offset, alpha)
    local angleOffset = 2
    local radianLeft = math.rad(angle + offset - angleOffset)
    local radianRight = math.rad(angle + offset + angleOffset)

    local endXL = 48 + radarRadius * math.cos(radianLeft)
    local endYL = 48 + radarRadius * math.sin(radianLeft)
    local endXR = 48 + radarRadius * math.cos(radianRight)
    local endYR = 48 + radarRadius * math.sin(radianRight)

    screen.setColor(0, 255, 0, alpha)
    screen.drawTriangleF(48, 48, endXL, endYL, endXR, endYR)
end

function onDraw()
    screen.setColor(0, 0, 0)
    screen.drawRectF(0, 0, 96, 96)
    screen.setColor(0, 150, 0, 100)  
    screen.drawLine(0, 48, 96, 48)
    screen.drawLine(48, 0, 48, 96)

    local smallCircle1Radius = radarRadius / 3
    local smallCircle2Radius = 2 * radarRadius / 3
    screen.drawCircle(48, 48, smallCircle1Radius)
    screen.drawCircle(48, 48, smallCircle2Radius)

    screen.setColor(0, 255, 0)    
    screen.drawCircle(48, 48, radarRadius)
    screen.drawCircleF(48, 48, 2)

    drawRadarBeam(scanAngle, -12, 20)
    drawRadarBeam(scanAngle, -8, 30)
    drawRadarBeam(scanAngle, -4, 40)
    drawRadarBeam(scanAngle, 0, 100)

    for _, target in ipairs(targets) do
        if target.visible then
            screen.setColor(table.unpack(target.color))
            screen.drawCircleF(target.x, target.y, 4)
        end
    end

    screen.setColor(255, 255, 255)
    local maxRangeKm = maxRadarRange / 1000
    screen.drawText(4, 4, string.format("%.1f Km", maxRangeKm))

    screen.setColor(0, 255, 0, 100)     
    local smallCircle1Distance = maxRadarRange / 3
    local smallCircle2Distance = 2 * maxRadarRange / 3
    
    screen.drawText(48 - 10, 48 - smallCircle1Radius - 5, string.format("%.0f", smallCircle1Distance))
    screen.drawText(48 - 10, 48 - smallCircle2Radius - 5, string.format("%.0f", smallCircle2Distance))
    screen.drawText(48 - 10, 48 - radarRadius - 5, string.format("%.0f", maxRadarRange))
end