#
##60個數量
n <- 60
##seq 可產生各種序列的函數
t <- seq(0, 2*pi, length=n)
##sin、cos三角函數公式,t為2*pi的計算
x <- sin(t)
y <- cos(t)
##作圖形式
par(pty = "s")
##展開作圖,點為三角函數減去1到n,Sys.sleep(x)代表延遲x秒
for (i in 1:n) {
plot.new()
plot.window(c(-1, 1), c(-1, 1))
lines(x*y, -y, col="gray")
points(x[i]*y[i], -y[i], pch=16,
col=gray((i-1)/(n+1)))
Sys.sleep(.05)
}
###