def get_boundaries_intersections(self, z, d, trust_radius):
a = np.dot(d, d)<EOL>b = <NUM_LIT:2> * np.dot(z, d)<EOL>c = np.dot(z, z) - trust_radius**<NUM_LIT:2><EOL>sqrt_discriminant = math.sqrt(b*b - <NUM_LIT:4>*a*c)<EOL>ta = (-b - sqrt_discriminant) / (<NUM_LIT:2>*a)<EOL>tb = (-b + sqrt_discriminant) / (<NUM_LIT:2>*a)<EOL>return ta, tb<EOL>
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.