user1765661
user1765661

Reputation: 595

Transform curve into linear

How can I transform the blue curve values into linear (red curve)? I am doing some tests in excel, but basically I have those blue line values inside a 3D App that I want to manipulate with python so I can make those values linear. Is there any mathematical approach that I am missing?

The x axis goes from 0 to 90, and the y axis from 0 to 1.

For example: in the middle of the graph the blue line gives me a value of "0,70711", and I know that in linear it is "0,5". I was wondering if there's an easy formula to transform all the incoming non-linear values into linear.

I have no idea what "formula" is creating that non-linear blue line, also ignore the yellow line since I was just trying to "reverse engineer" to see if would lead me to any conclusion.

Thank you

linear curve

Upvotes: 1

Views: 1227

Answers (2)

Marek
Marek

Reputation: 1543

Find a linear function y = ax + b that for x = 0 gives the value 1 and for x = 90 gives 0, just like the function that is represented by a blue curve.

In that case, your system of equations is the following:

1 = b // for x = 0
0 = a*90 + b // for x = 90

Solution provided by solver is the following : { a = -1/90, b = 1 }, the red linear function will have form y = ax + b, we put the values of a and b we found from the solver and we discover that the linear function you are looking for is y = -x/90 + 1 .

The tool I used to solve the system of equations:

http://wims.unice.fr/wims/en_tool~linear~linsolver.en.html

Upvotes: 1

Axel
Axel

Reputation: 14169

What exactly do you mean? You can calculate points on the red line like this:

f(x) = 1-x/90

and the point then is (x,f(x)) = (x, 1-x/90). But to be honest, I think your question is still rather unclear.

Upvotes: 0

Related Questions