local f=_Tune.Horsepower/100 local S=_Tune.PeakRPM/1000 local m=_Tune.PeakSharpness local x=_Tune.CurveMult local function s(s)s=s/1000 return(-(s-S)^2*math.min(f/S^2,x^(S/f))+f)*(s-s^m/(m*S)^(m-1))end local H=s(_Tune.PeakRPM)
--Horsepower Curve
local fgc_h = _Tune.Horsepower / 100
local fgc_n = _Tune.PeakRPM / 1000
local fgc_a = _Tune.PeakSharpness
local fgc_c = _Tune.CurveMult

local function FGC(x)
	x = x / 1000
	return (((-(x - fgc_n) ^ 2) * math.min(fgc_h / (fgc_n ^ 2), fgc_c ^ (fgc_n / fgc_h))) + fgc_h)
		* (x - ((x ^ fgc_a) / ((fgc_a * fgc_n) ^ (fgc_a - 1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
