update solution of lab02

This commit is contained in:
2025-01-22 14:05:54 -05:00
parent 93388c1fe2
commit b638fdea68
8 changed files with 52 additions and 12 deletions

View File

@@ -22,7 +22,7 @@ double gradient(const Line &ln) {
float gradient = 100.0 * fabs(slope);
// take the absolute value
if (gradient < 0) {
gradient * -1;
gradient *= -1;
}
return gradient;
}
@@ -37,6 +37,5 @@ bool steeper_gradient(const Line &m, const Line &n) {
return true;
if (gradient_n > gradient_m)
return false;
return false;
}