ASCIIMathML によるグラフ |
作成日:2014-02-23 最終更新日: |
Web ページでグラフを描くには、たとえば ASCIIsvg を使う方法がある。 ここでは別の方法を紹介する。
ASCIIMathML を使えばグラフも書ける。 ASCII Math Graphs というページがある。
\begin{graph} width=300; height=200; xmin=-6.3; xmax=6.3; xscl=1; plot(cos(log(x))); plot(2.2sin(x)) \end{graph}
\begin{graph} width=400; height=300; xmin=-8.3; xmax=8.3; xscl=1; plot(x-2); plot(2x-1) \end{graph}
\begin{graph} width=300; height=200; xmin=-6.3; xmax=6.3; xscl=1; plot(sin(x -(pi/2))) \end{graph}
\begin{graph} width=300; height=300; xmin=-10; xmax=10; xscl=4; plot(sin(x -(pi/2))) \end{graph}
\begin{graph} width=300; height=300; xmin=-10; xmax=10; xscl=4; plot(abs(abs(abs(x) - 4) - 4)) \end{graph}
\begin{graph} width=300; height=300; xmin=-5; xmax=5; xscl=2; plot(sign(x), -1, 1); plot(sign(x+2), -3, -1); plot(sign(x-2), 1,3) \end{graph}
\begin{graph} width=300; height=300; xmin=-11; xmax=11; xscl=2; plot(sin(5.5*x)/(0.5*x),-pi,pi); plot(sin(5.5*(x-2*pi))/(0.5*(x-2*pi)),pi,3*pi); plot(sin(5.5*(x+2*pi))/(0.5*(x+2*pi)),-3*pi,-pi); \end{graph}
`D_N(x) = 1 + 2 sum_(n=1)^N cos {:nx:} = (sin(N + 1/2) x) / (sin {:x/2:})`
上記は `N = 5` のときのグラフである。
まりんきょ学問所 > コンピュータの部屋 > マーク付け言語手習い > ASCIIMathML を使う