formatting
This commit is contained in:
@@ -169,10 +169,13 @@ double compute_slope(const Point &a, const Point &b) throw(int) {
|
|||||||
double rise = b.y - a.y;
|
double rise = b.y - a.y;
|
||||||
double run = b.x - a.x;
|
double run = b.x - a.x;
|
||||||
double epsilon = 0.00001;
|
double epsilon = 0.00001;
|
||||||
if (fabs(run) < epsilon) throw -1;
|
if (fabs(run) < epsilon){
|
||||||
return rise / run;
|
throw -1;
|
||||||
}
|
}
|
||||||
double slope(const Line &ln) {
|
return rise / run;
|
||||||
|
}
|
||||||
|
|
||||||
|
double slope(const Line &ln) {
|
||||||
return compute_slope(ln.a,ln.b);
|
return compute_slope(ln.a,ln.b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user