Description Usage Arguments Value Examples
Polar to Cartesian Coordinates
1 2 |
phi |
|
radius |
|
measure |
|
start |
|
direction |
|
[matrix]
Cartesian coordinates.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | all.equal(pol2cart(pi / 2), pol2cart(90, measure = "d"))
all.equal(pol2cart(pi / 2), pol2cart(1/4, measure = "t"))
oldpar <- par(pty = "s")
plot(pol2cart(1:360, measure = "d"), col = rainbow(360),
xlim = c(-1, 1), ylim = c(-1, 1))
par(oldpar)
oldpar <- par(pty = "s")
plot(pol2cart(seq(0, 2, len = 500), seq(0, 1, len = 500), measure = "t"),
col = rev(grey.colors(500)), pch = 16, xlim = c(-1, 1), ylim = c(-1, 1))
par(oldpar)
oldpar <- par(pty = "s")
plot(NA, xlim = c(-3, 3), ylim = c(-3, 3), xlab = "x", ylab = "y")
for (i in 1:360)
points(matrix(rnorm(2, as.numeric(pol2cart(i, 2, m = "d")), 0.2), 1))
par(oldpar)
oldpar <- par(pty = "s")
plot(NA, xlim = c(-3, 3), ylim = c(-3, 3), xlab = "x", ylab = "y")
points(rnhyper(100, pol2cart(45, 2, m = "d"), sd = 0.5), col = 2)
points(rnhyper(100, pol2cart(45 + 225, 2, m = "d"), sd = 1), col = 3)
points(rnhyper(100, pol2cart(45 + 90, 2, m = "d"), sd = 0.5), col = 4)
points(pol2cart(45 + c(0, 90, 225), 2, m = "d"), pch = 4, lwd = 3)
lines(pol2cart(seq(0, 1, len = 400), 2, m = "t"))
par(oldpar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.