formatting

This commit is contained in:
Jidong Xiao
2024-03-15 13:45:15 -04:00
parent 5274b88dd5
commit feea576130

View File

@@ -169,10 +169,13 @@ double compute_slope(const Point &a, const Point &b) throw(int) {
double rise = b.y - a.y;
double run = b.x - a.x;
double epsilon = 0.00001;
if (fabs(run) < epsilon) throw -1;
return rise / run;
if (fabs(run) < epsilon){
throw -1;
}
double slope(const Line &ln) {
return rise / run;
}
double slope(const Line &ln) {
return compute_slope(ln.a,ln.b);
}