2

So I am making an attack timeout based on a speed rating for a program that I am writing, but I am no genius when it comes to math. As it is i have a formula like so speed(x) = x/50 the base speed rating defaults at 100, so the attack would occur every two seconds at speed(100). Now what I want is for the attack to occur faster at a higher speed rating, and slower at a slower speed rating. I.e. speed(98) would return something higher than 2, while speed(101) would return something lower than 2. These numbers are just examples but the main point is that is there a formula that can return a lower number based on a higher base number, and vice versa?

Example: speed(101) = forumla; returns x < y and speed(98) = formula; returns x > y y being a constant number such as 2.

riyoken
  • 123
  • 3
  • Use $f(x)=x+ke^{-x}$. Where $k$ is some constant. Choose its value accordingly. You can also use something else instead of $e$... – AvZ Jan 31 '15 at 03:08
  • You just need some decreasing fuction... Try those which tend to $0$ as value grows. Like $f(x)=x+\frac{\frac{\pi}{2}-\arctan x}{k}$ – AvZ Jan 31 '15 at 03:10

1 Answers1

2

You could do speed(x)=200/x. Does that meet your need?

Ross Millikan
  • 374,822