local M = {}

local function init()
  electrics.values.asi320_mach_factor = 0
end

local function calculateSpeedOfSound()
  local T = electrics.values.tempC or 20
  return 331.2 + 0.6 * T
end

local function updateGFX(dt)
  electrics.values.asi320_mach_factor = obj:getVelocity():length() / calculateSpeedOfSound()
end

--public API
M.onInit = init
M.updateGFX = updateGFX

return M