-
Notifications
You must be signed in to change notification settings - Fork 0
/
EXP+QDRTC
70 lines (61 loc) · 1.77 KB
/
EXP+QDRTC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#EXP+QDRTC
#Imports
import time
import math
#Functions
#Base Equasion setup
def base_info():
print(" ")
val_a = int(input("Your Value for a: "))
val_b = int(input("Your Value for b: "))
val_c = int(input("Your Value for c: "))
#Equasion (ax**2 + bx + c)
print("Your Equasion = " + str(val_a) + "x^2 + " + str(val_b) + "x + " + str(val_c))
#Vertex (-b/2(a))
vertex = ((-1) * (val_b)) / (2 * (val_a))
Tvertex = vertex
#y-int (ax**2 + bx + c (x = 0))
y_int = ((val_a ** 0) + (val_b * 0) + (val_c))
#Discriminant (b^2 - 4(a)(c))
disc = ((val_b ** 2) - (4 * val_a * val_c))
if disc < 0:
deez = 2
if disc == 0:
deez = 1
if disc > 0:
deez = -2
#Solutions (-b +/- sqrt(disc))
if deez == 2:
solved_x1 = (((-1) * val_b) - math.sqrt((4 * val_a * val_c)))
solved_x2 = (((-1) * val_b) + math.sqrt((4 * val_a * val_c)))
if deez == 0:
solved_x1 = (((-1) * val_b) - math.sqrt((4 * val_a * val_c)))
#Answers (base)
#Equasion output already printed
print("Vertex: " + str(Tvertex))
print("y-int: " + str(y_int))
#Answers (solutions)
if deez == 2:
print("Solutions are: {" + str(solved_x1) + "," + str(solved_x2) + "}.")
if deez == 0:
print("Solutions are: {" + str(solved_x1) + "," + str(solved_x2) + "}.")
if deez == -1:
print("Solution contains no real numbers.")
#Intro
print("""
Welcome To
__________ __________
| ____\ \ / /| _ \ _
| |__ \ V / | |_) | _| |_
| __| > < | ____/|_ _|QDRTC
| |____ / _ \ | | |_|
|_______/__/ \__\| _|
EXPplusQDRTCv2.0.9
Duraenn
S3CO 2022""")
time.sleep(.5)
#Function
base_info()
time.sleep(2)
print("Thank You for using. Durian Technologies 2022.")
quit()