円を描く

t <- seq(0, 2, pi/1000) * pi
x <- cos(t)
y <- sin(t)
plot(x, y, type = "l", asp = 1)

plot of chunk unnamed-chunk-1


x <- t * cos(t)
y <- t * sin(t)
plot(x, y, type = "l", asp = 1)

plot of chunk unnamed-chunk-1

library(rgl)
t <- seq(0, 10, pi/1000) * pi
t <- seq(0, 2 * pi * 10, length = 1000)
x <- cos(t)
y <- sin(t)
plot3d(x, y, t)

plot of chunk unnamed-chunk-1

library(rgl)
t <- seq(-pi, pi, length = 100)
x <- c(rep(1, 100) %*% t(cos(t)))
y <- c(cos(t) %*% t(sin(t)))
z <- c(sin(t) %*% t(sin(t)))
plot3d(x, y, z, type = "p")

plot of chunk unnamed-chunk-1
裏RjpWiki ダメ出し:簡明直截なプログラミングをすれば,誤りもなくなる