All you need to do to rotate a point is provide a pivot point. Then you convert the rectangular coordinates to polar in relation to that point, add the rotation to the angle component, then convert back to rectangular.
Uh... You do realize that x^.5 is not the same as 2*x, right? And that formula is completely wrong, anyway.
r=(x1-x2+y1-y2)^.5
t=atan2(y1-y2,x1-x2)
Determining an angle from two sets of coordinates is such a common operation that atan2() exists just to do that. It even handles the cases when !x. If !x && !y, the function fails.