--Horsepower Curve


function curve(RPM)
	RPM=RPM/1000
	return ((-(RPM-PeakRPM)^2)*math.min(HP/(PeakRPM^2),CurveMult^(PeakRPM/HP))+HP)*(RPM-((RPM^Sharpness)/((Sharpness*PeakRPM)^(Sharpness-1))))
end

local PeakCurve = curve(_Tune.PeakRPM)
local Horsepower = math.max(curve(RPM)/(PeakCurve/HP),0)
