local l={}if _Tune.CacheTorque then for s,L in pairs(_Tune.Ratios)do local Q={}for l=math.floor(_Tune.IdleRPM/_Tune.CacheRPMInc),math.ceil((_Tune.Redline+100)/_Tune.CacheRPMInc),1 do local L={}L.Horsepower,L.Torque=GetCurve(l*_Tune.CacheRPMInc,s-2)hp1,tq1=GetCurve((l+1)*_Tune.CacheRPMInc,s-2)L.HpSlope=(hp1-L.Horsepower)/(_Tune.CacheRPMInc/1000)L.TqSlope=(tq1-L.Torque)/(_Tune.CacheRPMInc/1000)Q[l]=L end table.insert(l,Q)end end

local HPCache = {}

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