Created
March 16, 2022 22:55
-
-
Save theoparis/aaa73d3af5b829b74228259eb090607b to your computer and use it in GitHub Desktop.
Python quadratic equation solver test 1
This file contains hidden or 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
import math | |
print("format is ax^2+bx+c") | |
a = float(input("a=")) | |
b = float(input("b=")) | |
c = float(input("c=")) | |
# fomrula is -b^2-4ac | |
# ((b) - ((b) * (2))) * (b)= -b^2 | |
X = (b**2) - (4 * a * c) | |
# formula should be (-b(+ or -)sqrtx)/2a | |
Q = (-b + math.sqrt(X)) / (2 * a) | |
q = (-b - math.sqrt(X)) / (2 * a) | |
print("format is X=-b^2-4ac") | |
# This needs to have a comma to seperate the arguments! | |
print("x=", str(X)) | |
print("format is x=-b+(sqrt-b^2-4ac)/2a") | |
print("x=", str(Q)) | |
print("format is x=-b-(sqrt-b^2-4ac)/2a") | |
print("x=", str(q)) | |
o = (b) * (2) | |
v = (b) - (o) | |
e = (a) * (2) | |
x = (v) / (e) | |
print("axis of symetry=", str(x)) | |
f = (x) * (x) | |
h = (a) * (f) + (b) * (x) + (c) | |
print("vert 1 =") | |
print(x, h) | |
x = (x) + (1) | |
f = (x) * (x) | |
h = (a) * (f) + ((b) * (x)) + (c) | |
print("vert 2 =") | |
print(x, h) | |
x = (x) + (1) | |
f = (x) * (x) | |
h = (a) * (f) + ((b) * (x)) + (c) | |
print("vert 3 =") | |
print(x, h) | |
x = (x) - (3) | |
f = (x) * (x) | |
h = (a) * (f) + ((b) * (x)) + (c) | |
print("vert -2 =") | |
print(x, h) | |
x = (x) - (1) | |
f = (x) * (x) | |
h = (a) * (f) + ((b) * (x)) + (c) | |
print("vert -3 =") | |
print(x, h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment