开发者

How to calculate the curve of a linear floating point number in Javascript?

开发者 https://www.devze.com 2022-12-24 13:58 出处:网络
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

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 val开发者_如何学Cue.


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}

??

0

精彩评论

暂无评论...
验证码 换一张
取 消