2020/03/03

リサジュー曲線の書き方(3)

 前回の続きです。下記式で \(a, b\) を変化させるとどんな図形になるか実行してみます。

\( \begin{cases} x(t) = \cos(at)\\ y(t) = \cos(bt+c) \end{cases} \) \(\quad(0 \le t \lt 2\pi)\)

  \(a:b\) は \(x\) と \(y\) の周波数比を意味します。


書き方


 R言語での書き方は以下の通りです。

t=seq(0, 2*pi, length=300)
svg("freq.svg", width=5, height=12)
par(mfcol=c(4,2))
plot(sin(t),   sin(t+pi/2),   type="l", asp=1, col=2, lwd=2, main="a:b=1:1, c=90°")
plot(sin(t),   sin(2*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=1:2, c=90°")
plot(sin(t),   sin(3*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=1:3, c=90°")
plot(sin(t),   sin(4*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=1:4, c=90°")
plot(sin(2*t), sin(3*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=2:3, c=90°")
plot(sin(3*t), sin(5*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=3:5, c=90°")
plot(sin(5*t), sin(7*t+pi/2), type="l", asp=1, col=2, lwd=2, main="a:b=5:7, c=90°")
plot(sin(5*t), sin(7*t+pi/4), type="l", asp=1, col=2, lwd=2, main="a:b=5:7, c=45°")
dev.off()

 実行結果を以下に示します。

0 件のコメント:

コメントを投稿

マンデルブロ集合の彩色方法(5)

06.knit 1 発散判定式を変更する mandelbrot() 内の発散判定式 \(|z_n| > 2\) を変更する...