It uses knowledge of vector click to move the beam
the formula is taken from one of @piano_miles's fast sphere raytracing project