adds makeRays function for inverse mapping