円錐曲線とは
出典: フリー百科事典『ウィキペディア(Wikipedia)』
円錐曲線(えんすいきょくせん、conic curve, conic section; 円錐断面)とは、円錐面を任意の平面で切断したときの断面としてえられる曲線群の総称である。
数式表現
円
楕円
放物線
双曲線
書き方
R言語での書き方は以下のとおり。
円
条件:
1 2 3 4 5 6 7 8 9 | t=seq(0, 2*pi, length=180) a=1 x=a*cos(t) y=a*sin(t) svg("archimedes.svg", width=5, height=5) plot(x, y, type="l", asp=1, lwd=2, col=2) abline(h=0) abline(v=0) dev.off() |
楕円
条件:
1 2 3 4 5 6 7 8 9 10 | t=seq(0, 2*pi, length=180) a=3 b=2 x=a*cos(t) y=b*sin(t) svg("ellipse.svg", width=5, height=5) plot(x, y, type="l", asp=1, lwd=2, col=2) abline(h=0) abline(v=0) dev.off() |
放物線
条件:
1 2 3 4 5 6 7 8 | a=1 b=0 c=0 svg("parabola.svg", width=5, height=5) curve(a*x^2+b*x+c, -2, 2, asp=1, lwd=2, col=2) abline(h=0) abline(v=0) dev.off() |
双曲線
条件:
1 2 3 4 5 6 7 8 9 10 11 12 | a=1, b=1のとき t=seq(-pi, pi, length=300) a=b=1 x=a*cosh(t) y=b*sinh(t) svg("hyperbola.svg", width=5, height=5) plot( x, y, type="l", asp=1, lwd=2, col=2, xlim=c(-15,15), ylim=c(-15,15), ann=F) par(new=T) plot(-x, y, type="l", asp=1, lwd=2, col=2, xlim=c(-15,15), ylim=c(-15,15)) abline(h=0) abline(v=0) dev.off() |