Freeform gradient-index optics with applications in rotationally variant systems