# Arup Guha
# 8/27/2018
# Solves a Quadratic with real roots.

# Edited on 10/22/2020 to show that you can pass in a complicated
# expression for an actual parameter.

import math

# Read in the coefficients to the quadratic.
a = float(input("Please enter a from your quadratic equation.\n"))
b = float(input("Please enter b from your quadratic equation.\n"))
c = float(input("Please enter c from your quadratic equation.\n"))

# Real roots.
if discriminant >= 0:

    # Calculate both roots.
    root1 = (-b + math.sqrt(math.pow(b, 2) - 4*a*c))/(2*a)
    root2 = (-b - math.sqrt(math.pow(b, 2) - 4*a*c))/(2*a)

    # Print out the roots.
    print("The roots of your quadratic are",root1,"and",root2)

# Complex roots.
else:

    # Get the real and imaginary parts.
    real = -b/(2*a)
    img = math.sqrt(-discriminant)/(2*a)

    print("One root is ", real," + ", img, "i.", sep="")
    print("The other root is ", real," - ", img, "i.", sep="")
    
