Ray Tracing / Line intersection formulas between lines and various 2d and 3d objects are automatically derived using the computer-algebra system sympy.
See the collection here: https://johannesbuchner.github.io/intersection/
Send me a push request or email if you would like something added!