Skip to content

Instantly share code, notes, and snippets.

@snailmusic
Created December 3, 2020 23:25
Show Gist options
  • Save snailmusic/d71f1c6c89e356e5bb0457b043ce48c0 to your computer and use it in GitHub Desktop.
Save snailmusic/d71f1c6c89e356e5bb0457b043ce48c0 to your computer and use it in GitHub Desktop.
x = [0,0]
y = [0,0]
x[0] = int(input("x1: "))
y[0] = int(input("y1: "))
x[1] = int(input("x2: "))
y[1] = int(input("y2: "))
slope = [y[1]-y[0],x[1]-x[0]]
slopestr = f"{slope[0]}/{slope[1]}"
print(f"slope : {slopestr}")
print(f"point-slope form : y - {y[0]} = {slopestr}(y - {x[0]})")
psx = (x[0] * (slope[0]/slope[1])) + y[0]
print(f"y = {slopestr}x + {psx}")
@snailmusic
Copy link
Author

point slope was annoying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment