Tpl10を継承します。
ソースです。
import java.awt.Color; import java.awt.Graphics2D; import myMath.MyFunctionND; import myMath.Tpl10; public class TestMyFunctionNF01 extends Tpl10 { int t = 1; public void init() { tr.set(1, 0, 0, -1); tr.scale(50); tr.move(2, -2); setTimer(1000); } public void draw(Graphics2D g2) { MyFunctionND cv = new MyFunctionND(); double a = -2; double b = 2; // 軸 g2.setColor(Color.black); g2.draw(tr.LineX()); g2.draw(tr.LineY()); g2.setColor(Color.blue); while (true) { cv.set(1, 0); draw(cv, a, b); if (t == 1) break; cv.set(1, 0, 0); draw(cv, a, b); if (t == 2) break; cv.set(1, 0, 0, 0); draw(cv, a, b); if (t == 3) break; cv.set(1, 0, 0, 0, 0); draw(cv, a, b); if (t == 4) break; cv.set(1, 0, 0, 0, 0, 0); draw(cv, a, b); break; } t++; if (t > 5) t = 1; } }
\( y = x^n (n = 1, 2, 3, 4, 5) \) のグラフです。 右は、区間 [0, 1] だけです。
n を限りなく大きくすれば、 区間 [0, 1) では 0 になります。
\[ f(x) = \lim_{n \to \infty} x^n = \begin{cases} なし (x < 0 のとき) \\ 0 (0 \leq x < 1 のとき) \\ 1 (x = 1 のとき) \\ \infty (x > 1 のとき) \end{cases} \]