Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for this behavior to simulate the movement of the recoil of a gun.

I'm not sure the recoil exactly has this shape, that's a wild guess.

I'm looking for a function that does this approximately, or simulate the movement caused by recoil...

Something like f(t)=...

Any idea ?

Somebody told me about some probabilistic function of Maxwell something, but I can't use it without a time dependent formula.

share|cite|improve this question
Which kind of simulation? Different applications require different degrees of accuracy -- "I'm designing a gun stand" is not the same as "I'm animating a ship firing a broadside and want it to look somewhat realistic". – Henning Makholm Mar 13 '12 at 20:28
making a game, using 32 bit precision, which is not much but quite enough. Has to be fast. – jokoon Mar 13 '12 at 22:05
up vote 1 down vote accepted

Looks somewhat like a rescaled version of $y = x e^{-x}$. Try $y=cx e^{1-cx}$ with various choices of $c>1$. For example, try entering (5x)e^(1-5x) from 0 to 1 into Wolfram Alpha.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.