Created
July 5, 2017 10:17
-
-
Save MiyamotoAkira/a3761c73bdd692bb9047e078770613e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Line: | |
def __init__(self, x1, y1, x2, y2): | |
self.x1 = x1 | |
self.y1 = y1 | |
self.x2 = x2 | |
self.y2 = y2 | |
def find_x(self, y): | |
return ((self.x2*(y-self.y1)) - (self.x1*y)+(self.x1*self.y2))/(self.y2-self.y1) | |
def find_y(self, x): | |
return ((self.y2*(x-self.y1)) - (self.y1*x)+(self.y1*self.x2))/(self.x2-self.x1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment