Last active
August 29, 2015 14:27
-
-
Save k4kfh/ac751d2925e621895c85 to your computer and use it in GitHub Desktop.
Point Slope Form Equation Builder
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
#!/usr/bin/env python | |
print("Hampton [k4kfh] - blog.evilgeniustech.com") | |
firstx = float(input("What is the first X coordinate? ")) | |
firsty = float(input("What is the first Y coordinate? ")) | |
print("Ordered pair for first point: (%d, %d)") % (firstx, firsty) | |
secondx = float(input("What is the second X coordinate? ")) | |
secondy = float(input("What is the second Y coordinate? ")) | |
print("Ordered pair for second point: (%d,%d)") % (secondx, secondy) | |
rise = firsty - secondy | |
run = firstx - secondx | |
slope = (secondy - firsty)/(secondx - firstx) | |
print("Slope: %d/%d or %d") % ((firsty-secondy), (firstx-secondx), slope) | |
print("Point Slope Form Equation:") | |
print("y - %d = %d/%d(x - %d)") % (firsty, rise, run, firstx) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment