2

I'm trying to draw a curved graph as in Image 1 using the below function. But I got Image 2. How I can able to get exactly like Image 1 curve? :|

Sorry, I'm not good at Maths, so I just added my function below instead of the maths part. I just need the Maths part only, I'll convert it to the code :)

generateDummyData() {
  //       x  y
  rows = [[0, 0]];

  for (let i = 0; i < 8E3; i++) {
    rows.push([i, Math.floor(Math.log(i) * 32000)]);
  }

}

Image 1 (What I expect) enter image description here Image 2 (What I got) enter image description here

Thanks,

0xdw
  • 121
  • It looks a bit like the inverse tangent. – Blue Aug 24 '19 at 05:30
  • @Blue I'm not sure how to do it. :( – 0xdw Aug 24 '19 at 05:33
  • 1
    For instance, $y=200 \operatorname{atan}\left(\frac{x}{100}\right)$ agrees at $(0,0)$. For $x=200$, it gives $y\approx 221$. It levels-off at $314.159\ldots$ (aka, $100\pi$), though. (I consider this a bonus! :) You can play with $y=a \operatorname{atan}\left(\frac{x}{b}\right)$ to see if you get anything closer to what you want. Another thing to try is something like $y=a(1-\exp(-bx))$. – Blue Aug 24 '19 at 06:02
  • 1
    looks like charging of a capacitor with large time constant. You may try modifying R, C values in https://www.desmos.com/calculator/3myhlifwhl – AgentS Aug 24 '19 at 06:06

0 Answers0