Adjusting the steepness of a curve

332 Views Asked by At

I've got an array of numbers, each between 1 and 0, sorted in descending order.

When i put those numbers on a graph, they decrease too quickly:

enter image description here

I would like to create a function f(number, coefficient). By adjusting the coefficient and applying the function to every number in the array i would like to be able to adjust how steep the curve is.

On the picture below, the coefficient is symbolized by the length of the green arrow:

enter image description here

A certain value of the coefficient (e. g. 0 or 1) should result in an unmodified curve.

PS I use Javascript and it has log(number) and log10(number) functions.

2

There are 2 best solutions below

0
On
0
On

In your sample adjusted graph it appears that the new $x$-coordinates are about twice the old ones. So, if we let the coefficient $c$ be the amount of the stretch of the $x$-coordinate, you stretch the graph of $$y=f(x)$$ by instead graphing $$y=f(\frac xc)$$ By the chain rule, this decreases the steepness of the curve at any point by $c$.

You obviously get the original graph by setting the coefficient $c$ to $1$.

There are many other ways to get the steepness decrease to be more drastic either as $x$ approaches zero or as $x$ moves away from zero. The method I give here has a uniform decrease in steepness, as you apparently show in your example.