StraightLine: fixed typo while referencing line get_m()
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
bc790e21c3
commit
4c4366a5d1
@ -93,7 +93,7 @@ class StraightLine:
|
|||||||
def intercept(self, line) -> Point:
|
def intercept(self, line) -> Point:
|
||||||
# Basically when the two lines have the same cords (x,y)
|
# Basically when the two lines have the same cords (x,y)
|
||||||
# As a formula x = (b2 - b1)/ (m1 + m2) to find X, then apply y = mx + b on any line
|
# As a formula x = (b2 - b1)/ (m1 + m2) to find X, then apply y = mx + b on any line
|
||||||
x = (line.get_b() - self.get_b()) / (line.get_m() + line.get_m())
|
x = (line.get_b() - self.get_b()) / (line.get_m() + self.get_m())
|
||||||
y = self.get_m()*x + self.get_b() # Inline to reduce overhead
|
y = self.get_m()*x + self.get_b() # Inline to reduce overhead
|
||||||
return Point(x, y)
|
return Point(x, y)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user