vector qroots( double a, double b, double c)
{
/*					 2
 * find roots of quadratic equation:  a x   +  b x  +  c  =  0
 */

double d, r1, r2;

    if( a == 0) {
	print( "qroots: a != 0 required");
	return [0 0];
    }

    d = b*b - 4*a*c;

    if( d < 0) {
	print( "qroots: complex roots!");
	d = sqrt( -d);
	return [ -b d; -b -d] / (2*a);
    }

    d = sqrt(d);

    if( b < 0)				/* get largest root first */
	r1 = (-b + d) / (2*a);
    else
	r1 = (-b - d) / (2*a);

    r2 = c / (a * r1);

    return [r1 r2];
}
