views:

76

answers:

1

How do I calculate a curve of a linear floating point number (0 to 1) and get another floating point number as a result? What I want is up until the half (0..0.5), to be inversed logarithmic and high than that to be logarithmic like a curve according to the given linear value.

A: 

So, what you are looking for is a function to do:

double x, y;
y = 1.0 / log(x) {x = 0 .. 0.5}
    log(x)     {x = 0.5 .. 1}

??

or:

y = exp(x) {x = 0 .. 0.5}

??

ysap