Ray plane intersection function

This is a patch to implement issue #66 which is suggested a while ago.