The article describes an algorithm for generating fractals using polar coordinates. The classic Julia and Mandelbrot polynomial iteration applied to a complex number is replaced by an iteration with separate functions for distance and angle. A polynomial function is used for an angle and a power function for a distance. Varying the functions parameters allows to create a wide range of attractive pictures. Distance values are used for coloring fractal images.