racine.py

Created by francoise-cavanne

Created on September 11, 2018

479 Bytes

discriminant , racines , sommet


from math import*

def discriminant(a,b,c):
    return b*b-4*a*c



def racines(a,b,c):
    delta=discriminant(a,b,c)
    if delta == 0 :
        return -b/(2*a)
    elif delta > 0 :
        x_1=(-b-sqrt(delta))/(2*a)
        x_2=(-b+sqrt(delta))/(2*a)
        return x_1,x_2
    else :
        return 'pas de racines reelles'
        #        return None
    

def formecanonique(a,b,c):
    alpha= -b/(2*a)
    beta= a*(alpha)**2+b*alpha+c
    return alpha,beta

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.