In Cartesian coordinates, the generic circumference equation with center at point p_0=(x_0,y_0)p0=(x0,y0) and radius rr is (x-x_0)^2+(y-y_0)^2=r_0^2(x−x0)2+(y−y0)2=r20
The pass equations are
((x=r*cos(theta)),(y=r*sin(theta)))
substituting we have
(r*cos(theta)-x_0)^2+(r*sin(theta)-y_0)^2=r_0^2.
Simplifying
r^2-2r(x_0 cos(theta)+y_0 sin(theta))=r_0^2-x_0^2-y_0^2
If now we call
x_0=r_0 cos(theta_0) and y_0 = r_0 sin(theta_0)
and substituting, after the identity
cos(theta-theta_0)=sin(theta)sin(theta_0)+cos(theta)cos(theta_0)
we get
r^2+2r r_0 cos(theta-theta_0)-r_0^2+x_0^2+y_0^2
Example.
Taking (x-5)^2+(y-4)^2 = 1
we have x_0 = 5, y_0 = 4, r_0 = 1, theta_0 = arctan(4/5)
so
r^2+2 r cos(theta - theta_0) - 1+5^2+4^2 = 0
or the other presentation
(4 - r cos(theta))^2 + (5 - r sin(theta))^2=1