I'm trying to render an equation in the cylindrical coordinates, and I used the following codes:
With[{λ = 1, f = 50, R = 25}, ContourPlot[ -Mod[(Pi/λ)*(Sqrt[ρ^2 + f^2] - f), Pi] /. {ρ -> Norm[{x, y}], ϕ -> ArcTan[x, y]}, {x, -R, R}, {y, -R, R}, Contours -> 20, ContourLines -> False, RegionFunction -> (Sqrt[#1^2 + #2^2] < R &), ColorFunction -> "Rainbow", Frame -> False]] However, I got a pattern which seems not smooth because points were sampled equally in the Cartesian coordinates. How can I get a smooth contour plot? Furthermore, can I plot such a pattern in the 3D coordinates? Thanks a lot.
Here is an example of the output that I would like:



