--Output Cache

local CacheTorque = true
local HPCache = {}
local HPInc = 100

if CacheTorque then
	for gear,ratio in pairs(_Tune.Ratios) do
		local hpPlot = {}
		for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
			local tqPlot = {}
			tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
			hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
			tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
			tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
			hpPlot[rpm] = tqPlot
		end
		table.insert(HPCache,hpPlot)
	end
end
