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

enter image description here

I didn't use math since ages , now I am building a game (I am a programmer) and I need a mathematical function to draw the following 2 lines

The red thick line goes from x=1 to x=10 (it may go less than x=1 but I don't care for the output for x<1 , but this probably would be useful to determine the shape of the line (the 2 thin red lines)) I would be pleased if anyone could tell me the function of the red line and any help on how to change it's shape (lets say make f(5) for the thin line > f(5) for the thick line where f(1) and f(10) are the same for the thick and thin line .

The green line goes from (x,infinity) , I don't care for its shape , the most important is f(20) for the green line = 12000000 and f(infinity) for the green line is closer to 15000000 .

Any help guys would be great . I really searched over the internet for 3 days , nothing :(

Thank you .

share|cite|improve this question
up vote 0 down vote accepted

For the green graph, the equation
$$y = 15000000 - \frac{50000000}{x} - \frac{200000000}{x^2}$$ will do. It goes through $(10, 8000000)$ and $(20, 12000000)$ and has a horizontal asymptote at $y=15000000$, as can be seen in this plot.

For the red graph, I started with a basic exponential $f(x) = Ae^{Bx}+C$. The prerequisites $f(1)=1000$ and $f(10)=8000000$ give us \begin{align*} 1000 &= Ae^B + C\\ 8000000 &= A e^{10B} + C \end{align*} and subtracting these gives $7999000 = A(e^{10B}-e^B)$.
Given the value of $B$, the values of $A$ and $C$ can then be found by calculating \begin{align*} A &= \frac{7999000}{e^{10B} - e^B}\\ C &= 1000 - Ae^B. \end{align*} In this plot , I choose $B=1$ for the middle line, and $B=0.9$ and $B=1.1$ for the others.
Computing $A$ and $C$ as described, the three graphs are \begin{align*} y &= 363.20 \; e^{0.9x} + 12.72\\ y &= 133.60 \; e^{1.0x} + 598.63\\ y &= 987.45 \; e^{1.1x} - 1428.75. \end{align*}

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.