A working version of the prediction algorithm. Currently it works only with two rays, but I believe it should be easily expanded to
work with rays and cylinders.