A General Solution for Double-Layer Gradient-Index and Geodesic Lenses with Rotational Symmetry