# Anuloid (Torus) x line intersection

Hi,

I need calculate ray (line) intersection with torus for my ray-tracing program (I know, its to graphics, but i need math behind it).

I can solve equation of order x^4, but thats too way slow (Cardano's method). So is there better way, how to calculate this ?

Thanks

-
math.stackexchange.com is probably a better fit for your question. If you do not provide details about how you are representing the torus, it is impossible to answer your question. –  Mariano Suárez-Alvarez Oct 25 '10 at 17:38
I have Center [0,0,0] and R, r diameters Line (Ray) is represented with point and its direction vector –  Johnatan Oct 25 '10 at 17:45
Cross-posted to MSE: math.stackexchange.com/questions/7829/… –  Joseph O'Rourke Oct 25 '10 at 20:08
I removed the intersection theory tag since in mathematics it has a specific meaning. I added computing as a trade off. –  Benoît Kloeckner Mar 1 '11 at 18:18

If you can't avoid solving 4th degree equations, don't use complicated solutions in terms of radicals. Computing radicals is not really any more efficient than computing roots of general polynomials, so this only serves to make the problem more complicated (ignoring other problems such as casus irreducibilis). Instead, apply a suitable root-finding algorithm on the original polynomial.

-