'Solve the scalar quadratic equation ||z + t d|| == trust_radius.
This is like a line-sphere intersection.
Return the two values of t, sorted from low to high.'

def get_boundaries_intersections(self, z, d, trust_radius):

    a = np.dot(d, d)
    b = (2 * np.dot(z, d))
    c = (np.dot(z, z) - (trust_radius ** 2))
    sqrt_discriminant = math.sqrt(((b * b) - ((4 * a) * c)))
    aux = (b + math.copysign(sqrt_discriminant, b))
    ta = ((- aux) / (2 * a))
    tb = (((-2) * c) / aux)
    return sorted([ta, tb])
