2020年7月10日金曜日

学習環境

新装版 数学読本3 (松坂 和夫(著)、岩波書店)の第12章(放物線・だ円・双曲線 - 2次関数)、12.1(放物線・だ円・双曲線)、双曲線の問8の解答を求めてみる。



    1. 漸近線。

      y=±34x

      頂点。

      (±4,0)

      焦点。

      (±16+9,0)=(±5,0)

      概形。


    2. x24-y29=1

      漸近線、頂点、焦点。

      y=±32x
      (±2,0)
      (±13,0)

      概形。


    3. 漸近線、頂点、焦点。

      y=±x
      (±1,0)
      (±2,0)

      概形。


    4. x225-y24=1

      漸近線、頂点、焦点。

      y=±25x
      (±5,0)
      (±29,0)

      概形。


    5. 漸近線、頂点、焦点。

      y=2x
      (0,±6)
      (0,±3)

      概形。


    6. x2(12)2-y2(13)2=-1

      漸近線、頂点、 焦点。

      y=±1312x=±23x
      (0,±13)
      (0,±14+19)=(0,±1336)=(0,±136)

      概形。

コード

#!/usr/bin/env python3
import matplotlib.pyplot as plt
from matplotlib import animation
from sympy import sqrt

print('6.')

frames = 50
x0 = 12 / frames


def update(i: int, circle1, center2):
    u = -6 + x0 * (i + 1)
    v = sqrt(6 ** 2 - u ** 2)
    plt.plot([u, 0], [0, v])
    plt.plot([u, 0], [0, -v])
    x = u / 3
    y = 2 * v / 3
    circle1.center = x, y
    circle2.center = x, -y


fig = plt.gcf()
ax = plt.axes(xlim=(-6, 6), ylim=(-6, 6), aspect='equal')
circle1 = plt.Circle((-2, 0), 0.15)
circle2 = plt.Circle((-2, 0), 0.15)
ax.add_patch(circle1)
ax.add_patch(circle2)
plt.plot([-6, 0], [0, 0])
anim = animation.FuncAnimation(fig,
                               update,
                               fargs=(circle1, circle2),
                               frames=50,
                               interval=100,
                               repeat=True)
plt.show()
anim.save('sample6.gif', writer='imagemagick')

入出力結果(Zsh、PowerShell、Terminal、Jupyter(IPython))

% ./sample8.py     
8.
(1)
(2)
(3)
(4)
(5)
(6)
%

0 コメント:

コメントを投稿