21 const float s = std::exp(
a);
22 const float s2 = 1.0f /
s;
23 const float t =
max(0.0f,
min(1.0f,
b));
25 const float eps = 0.00001f;
32 c1 = (
t *
x) / (
x +
s * (
t -
x) + eps);
33 c2 =
t - std::pow(1 / (
t + eps), s2 - 1.0f) * std::pow(
abs(
x -
t), s2);
34 c3 = std::pow(1.0f / (
t + eps),
s - 1.0f) * std::pow(
x,
s);
37 c1 = (1.0f -
t) * (
x - 1.0f) / (1.0f -
x -
s * (
t -
x) + eps) + 1;
38 c2 = std::pow(1.0f / ((1.0f -
t) + eps), s2 - 1.0f) * std::pow(
abs(
x -
t), s2) +
t;
39 c3 = 1.0f - std::pow(1 / ((1.0f -
t) + eps),
s - 1.0f) * std::pow(1.0f -
x,
s);
42 res = (-
u) * c2 + (1.0f +
u) * c1;
45 res = (
u)*c3 + (1.0f -
u) * c1;
float calc_tor_curve(float x, float a, float b, float c)
A generalized curve formula.
constexpr float abs(float r)
size2f min(const size2f lhs, const size2f rhs)
size2f max(const size2f lhs, const size2f rhs)