Doing raytracing in javascript is a bad idea. Period. There are many ways to do 3d on the web with greater flexibility and WAY more performance. WebGL is one, CUDA support in javascript is another:
http://mozillalabs.com/jetpack/2010/01/25/elevating-javascri.... There is no reason to do that type of computation in the interpretation layer of javascript. (This is akin to saying you would prefer a pure python implementation of disk io, as opposed to the built in method which is implemented in C.)