local j=true local F={}local I=100 if j then for j,n in pairs(_Tune.Ratios)do local w={}for F=math.floor(_Tune.IdleRPM/I),math.ceil((_Tune.Redline+100)/I),1 do local n={}n.Horsepower,n.Torque=GetCurve(F*I,j-2)hp1,tq1=GetCurve((F+1)*I,j-2)n.HpSlope=(hp1-n.Horsepower)/(I/1000)n.TqSlope=(tq1-n.Torque)/(I/1000)w[F]=n end table.insert(F,w)end end
--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
