Try alternative curve formula
This commit is contained in:
parent
11569378ab
commit
5bd80b4834
1 changed files with 5 additions and 5 deletions
|
|
@ -79,20 +79,20 @@ Curve Curve::buildPredefinedCurve(int index)
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
for (unsigned i = 0; i < NumValues; ++i) {
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = x * x;
|
curve._points[i] = x * x;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
for (unsigned i = 0; i < NumValues; ++i) {
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = std::pow(x, 0.5);
|
curve._points[i] = std::sqrt(x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
for (unsigned i = 0; i < NumValues; ++i) {
|
for (unsigned i = 0; i < NumValues; ++i) {
|
||||||
double x = i * (1.0 / (NumValues - 1));
|
double x = i / static_cast<double>(NumValues - 1);
|
||||||
curve._points[i] = std::pow(1.0 - x, 0.5);
|
curve._points[i] = std::sqrt(1.0 - x);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue