Remove duplication from the rotation and reflection code in the geometric grid