function solveQuadratic(a, b, c, result) {
  const det = b * b - 4.0 * a * c;
  if (det < 0.0) {
    return undefined;
  } else if (det > 0.0) {
    const denom = 1.0 / (2.0 * a);
    const disc = Math.sqrt(det);
    const root0 = (-b + disc) * denom;
    const root1 = (-b - disc) * denom;

    if (root0 < root1) {
      result.root0 = root0;
      result.root1 = root1;
    } else {
      result.root0 = root1;
      result.root1 = root0;
    }

    return result;
  }

  const root = -b / (2.0 * a);
  if (root === 0.0) {
    return undefined;
  }

  result.root0 = result.root1 = root;
  return result;
}
Computes the intersection of a line segment and a triangle.
@memberof IntersectionTests

@param {Cartesian3} v0 The an end point of the line segment.
@param {Cartesian3} v1 The other end point of the line segment.
@param {Cartesian3} p0 The first vertex of the triangle.
@param {Cartesian3} p1 The second vertex of the triangle.
@param {Cartesian3} p2 The third vertex of the triangle.
@param {boolean} [cullBackFaces=false] If <code>true</code>, will only compute an intersection with the front face of the triangle
                 and return undefined for intersections with the back face.
@param {Cartesian3} [result] The <code>Cartesian3</code> onto which to store the result.
@returns {Cartesian3} The intersection point or undefined if there is no intersections.