title: Solving Quadratic Equation Equal to 0 in Python
body: <p>I'm new to the python language and I'm trying to write a program to solve for a bunch of time/distance/acceleration variables. I know I need some kind of solve function to use in the Dtot-Dacceleration-Dconstant-Dbraking=0 line, but I don't know what function to use or what the syntax is for it. Here's my code for one chunk of it, any help would be appreciated!</p>
  
  <pre><code>def VehicleProfile(Vi, Fa, Fd, Dtot, Vf, Taccel):
  
      Vconstant = Vi+(Fa*9.81*Taccel)
      Dacceleration = (Vi*Taccel)+(.5*Fa*9.81*(Taccel**2))
      Dconstant = Vconstant*Tconstant
      Dbraking = ((Vf**2)-(Vconstant**2))/(2*Fd*9.81)
      Tbraking = (Vf-Vconstant)/(Fd*9.81)
      Dtot-Dacceleration-Dconstant-Dbraking=0
      return (Tconstant, Tbraking)
  </code></pre>
  
  <p>Also I'm using python 2.7.7</p>