Fixed mistyped method.
The type error was pointed out by @adsharma in #4.
This commit is contained in:
parent
1b533aac0c
commit
457f5d1703
1 changed files with 2 additions and 2 deletions
|
@ -33,11 +33,11 @@ class Segment:
|
||||||
assert self.l.x <= x <= self.r.x
|
assert self.l.x <= x <= self.r.x
|
||||||
return self.slope() * (x - self.l.x) + self.l.y
|
return self.slope() * (x - self.l.x) + self.l.y
|
||||||
|
|
||||||
def approximately_equal(self, other: 'Segment') -> float:
|
def approximately_equal(self, other: 'Segment') -> bool:
|
||||||
return (math.isclose(self.l.y, other.l.y, rel_tol=1e-5) and
|
return (math.isclose(self.l.y, other.l.y, rel_tol=1e-5) and
|
||||||
math.isclose(self.r.y, other.r.y, rel_tol=1e-5))
|
math.isclose(self.r.y, other.r.y, rel_tol=1e-5))
|
||||||
|
|
||||||
def compatible(self, other: 'Segment') -> float:
|
def compatible(self, other: 'Segment') -> bool:
|
||||||
return self.l.x == other.l.x and self.r.x == other.r.x
|
return self.l.x == other.l.x and self.r.x == other.r.x
|
||||||
|
|
||||||
def slope(self) -> float:
|
def slope(self) -> float:
|
||||||
|
|
Loading…
Reference in a new issue