Added function to project point onto a ray