Square inside a Polar coordinate system I have a square lying on a polar coordinate. Is there any general relationship between radius and angle, which may be derived along the side of square. More generally put, given the coordinates of the corners of square; at any arbitrary point with angle theta on any of the sides of square how may I get the radius of same?
 A: Let's assume the square has unit side length and is centered at the origin. To derive the equation for, say, the right edge of the square in polar coordinates, we note that the right edge has defining equations $x=1, -1\leq y\leq 1$. We can simply notice that this line segment occupies only the range $-\frac{\pi}{4}\leq\theta\leq\frac{\pi}{4}$ in polar, or substitute the polar equations for $x$ and $y$ above to get
$r\cos(\theta)=1,\\r\sin(\theta)\in[-1,1].$
Solving for $r$ in the first equation gives $r=\sec(\theta)$, which is the polar equation for the right side; substituting it in the second equation gives us the range for $\theta$ mentioned above. Similar methods can be used for the other sides.
If the side lengths and center don't agree with the one here, then instead of, say $x=r\cos(\theta)$, we'll first make a $u,v$ substitution for $x,y$ so that the square in $u,v$ coordinates looks like the standard one with unit side length centered at the origin.
For example, if the square has side length $s$ and is centered at $(c,d)$ and is rotated by some angle $\omega$, then first substitute
$x'=(x-c)/s \\ y'=(y-d)/s$
and then multiply $(x',y')$ by the two-dimensional rotation matrix with angle $-\omega$ to obtain $(u,v)$. Then carry out the procedure above.
