;Finds the roots of the quadratic equation a*x^2+b*x+c=0 ; ; input ; a - Quadratic coefficient. May be an array of any shape ; b - Linear coefficient. May be array, but must be same shape as a ; c - Constant coefficient. May be array, but must be same shape as a ; output keywords ; d - Discriminant. Same shape as a. Wherever there is a negative value in this ; array, there are no real roots, and root1 and root2 will have NaN in ; the corresponding elements ; root1 - Root found by using + sign in quadratic formula ; root2 - Root found by using - sign in quadratic formula pro quadratic_formula,a,b,c,d=d,root1=root1,root2=root2 d=b^2-4*a*c root1=(-B+sqrt(D))/(2*A); root2=(-B-sqrt(D))/(2*A); end