2020年7月10日金曜日

学習環境

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



    1. 漸近線。

      y = ± 3 4 x

      頂点。

      ( ± 4 , 0 )

      焦点。

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

      概形。


    2. x 2 4 - y 2 9 = 1

      漸近線、頂点、焦点。

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

      概形。


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

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

      概形。


    4. x 2 25 - y 2 4 = 1

      漸近線、頂点、焦点。

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

      概形。


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

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

      概形。


    6. x 2 ( 1 2 ) 2 - y 2 ( 1 3 ) 2 = - 1

      漸近線、頂点、 焦点。

      y = ± 1 3 1 2 x = ± 2 3 x
      ( 0 , ± 1 3 )
      ( 0 , ± 1 4 + 1 9 ) = ( 0 , ± 13 36 ) = ( 0 , ± 13 6 )

      概形。

コード

#!/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 コメント:

コメントを投稿