Explanation of this image warping (bulge filter) algorithm I've been researching image warping algorithms lately and haven't found many comprehensive references.  That said, there are of course code snippets from GIMP, jhlabs.com, and imagemagick.org but none of these explain the mathematics behind the process. This stackoverflow post gives a very nice and concise example of the bulge warp effect, but it also lacks detailed explanation.  Here is the meat of the math:
Suppose your image coordinates go from 0 to 1.
If you define:
r = Sqrt[(x - .5)^2 + (y - .5)^2]
a = ArcTan[x - .5, y - .5]
rn = r^2.5/.5 

/* NB: arctan is not really necessary since Cos[a] = (x - .5)/r 
and Sin[a] = (y - .5)/r
*/

And then remap your pixels according to:
x -> rn*Cos[a] + .5 
y -> rn*Sin[a] + .5  

Result:

So the question is, what exactly mathematically is going on here?  Why does this produce the circular bulge warp?  If I wanted the bulge to expand in, say, a triangular pattern, or perhaps with a bias of weighted points rather than equally in all directions, how would I change the trigonometry functions (if at all - a constraint over the given circular pattern might make more sense)? 
 A: The code takes each pixel location $(x,y)$, shifts it relative to the image center (0.5,0.5), converts it to polar form $(r,a)$ (so that $x-0.5=r \cos a, y-0.5= r \sin a$) and then maps the point to a new polar point $(\hat{r},a)$ where
$$
\hat{r} = 2 r^{2.5}
$$
(My $\hat{r}$ is called rn in your code.) Finally, the point is shifted by 0.5 horizontally and vertically.
This results in an increased radius, with a greater increase for larger radii: this gives the bulging effect. Note that the center of the image is fixed: the center (0.5,0.5) gets shifted to (0,0) which has a radius of r=0, so $r'=0$. Pixels are "pushed out" away from the center of the image in a non-linear way.
Having $r'=kr$, for a positive constant $k$, for example, would result in a simple scaling of the image about the center.
(Note $2r^{2.5}>r$ for $r>0.6299...$.)
The circular nature you mention is a result of all points at the same distance from the center being treated the same way: $\hat{r}$ only depends on $r$.
To get other kinds of distortion, try making $\hat{r}$ dependent on $r$ and other variables, like $a$, $x$, or $y$.  This will get you some non-circular distortions.  
