mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 05:45:33 +00:00
Bug 1713520 - Remove "else" after "return" in FindInflectionPoints r=nical
Differential Revision: https://phabricator.services.mozilla.com/D116436
This commit is contained in:
parent
bb7e748707
commit
560f3f056d
@ -401,37 +401,37 @@ static inline void FindInflectionPoints(
|
||||
*aT1 = -c / b;
|
||||
*aCount = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
double discriminant = b * b - 4 * a * c;
|
||||
|
||||
if (discriminant < 0) {
|
||||
// No inflection points.
|
||||
*aCount = 0;
|
||||
} else if (discriminant == 0) {
|
||||
*aCount = 1;
|
||||
*aT1 = -b / (2 * a);
|
||||
} else {
|
||||
double discriminant = b * b - 4 * a * c;
|
||||
|
||||
if (discriminant < 0) {
|
||||
// No inflection points.
|
||||
*aCount = 0;
|
||||
} else if (discriminant == 0) {
|
||||
*aCount = 1;
|
||||
*aT1 = -b / (2 * a);
|
||||
/* Use the following formula for computing the roots:
|
||||
*
|
||||
* q = -1/2 * (b + sign(b) * sqrt(b^2 - 4ac))
|
||||
* t1 = q / a
|
||||
* t2 = c / q
|
||||
*/
|
||||
double q = sqrt(discriminant);
|
||||
if (b < 0) {
|
||||
q = b - q;
|
||||
} else {
|
||||
/* Use the following formula for computing the roots:
|
||||
*
|
||||
* q = -1/2 * (b + sign(b) * sqrt(b^2 - 4ac))
|
||||
* t1 = q / a
|
||||
* t2 = c / q
|
||||
*/
|
||||
double q = sqrt(discriminant);
|
||||
if (b < 0) {
|
||||
q = b - q;
|
||||
} else {
|
||||
q = b + q;
|
||||
}
|
||||
q *= -1. / 2;
|
||||
|
||||
*aT1 = q / a;
|
||||
*aT2 = c / q;
|
||||
if (*aT1 > *aT2) {
|
||||
std::swap(*aT1, *aT2);
|
||||
}
|
||||
*aCount = 2;
|
||||
q = b + q;
|
||||
}
|
||||
q *= -1. / 2;
|
||||
|
||||
*aT1 = q / a;
|
||||
*aT2 = c / q;
|
||||
if (*aT1 > *aT2) {
|
||||
std::swap(*aT1, *aT2);
|
||||
}
|
||||
*aCount = 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user