local u=true local R={}local X=100 if u then for u,S in pairs(_Tune.Ratios)do local V={}for R=math.floor(_Tune.IdleRPM/X),math.ceil((_Tune.Redline+100)/X),1 do local S={}S.Horsepower,S.Torque=GetCurve(R*X,u-2)hp1,tq1=GetCurve((R+1)*X,u-2)S.HpSlope=(hp1-S.Horsepower)/(X/1000)S.TqSlope=(tq1-S.Torque)/(X/1000)V[R]=S end table.insert(R,V)end end

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
