pol2car | R Documentation |
Transform polar to Cartesian coordinates
pol2car(p)
p |
A vector of length |
A vector of length d
holding the corresponding Cartesian coordinates
\left(r\prod_{i=1}^{d-1}\cos\theta_i, r\sin\theta_1\prod_{i=2}^{d-1}\cos\theta_i, r\sin\theta_2\prod_{i=3}^{d-1}\cos\theta_i,\dots, r\sin\theta_{d-2}\cos\theta_{d-1}, r\sin\theta_{d-1}\right),
where r
is given by p[1]
and \theta_i
is given by p[i+1]
for i=1,\dots,d-1
.
pol2car(c(1, 0, pi/4)) # should equal c(1,0,1)/sqrt(2)
pol2car(c(1, pi, 0)) # should equal c(-1,0,0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.