\HeaderA{polar2xy}{Functions to perform polar coordinate related functions}{polar2xy}
\aliasA{rotate}{polar2xy}{rotate}
\aliasA{xy2polar}{polar2xy}{xy2polar}
\keyword{manip}{polar2xy}
\begin{Description}\relax
Functions to perform polar coordinate related functions
\end{Description}
\begin{Usage}
\begin{verbatim}
polar2xy(rho, theta)
xy2polar(x, y)
rotate(x, y, alpha)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] cartesian coordinate 
\item[\code{y}] cartesian coordinate  
\item[\code{rho}] polar radius \code{rho} 
\item[\code{theta}] polar angle \code{theta}
\item[\code{alpha}] angle to perform rotation 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{y} and \code{theta} can be respectively missing. In this case,
\code{x} and \code{rho} are expected to be lists with entries
\code{x, y}, \code{rho, theta} respectively.
\end{Details}
\begin{Value}
\end{Value}
\begin{Examples}
\begin{ExampleCode}

n <- 40
nn <- 2
thetas <- seq(0, nn * 2 * pi, length=n)

rhos <- seq(1, n) / n

plot(c(-1, 1), c(-1, 1), type="n")
abline(h=0, col="grey")
abline(v=0, col="grey")

xy <- polar2xy(rhos, thetas)

points(xy$x, xy$y, col=rainbow(n))

\end{ExampleCode}
\end{Examples}

