2020年3月7日土曜日

学習環境

ラング線形代数学(上) (ちくま学現文庫)(S.ラング (著)、芹沢 正三 (翻訳)、筑摩書房)の4章(線形写像)、1(写像)、練習問題8の解答を求めてみる。


  1. y = ± 1 - x 2 F x , y = F x , ± 1 - x 2 = 2 x , ± 3 1 - x 2 y = ± 3 1 - x 2 2 y 2 9 = 1 - x 2 4 x 2 4 + y 2 9 = 1

    よって、問題の写像の原点を中心とする半径1の円の上の点の像は、 上記の楕円。

コード

#!/usr/bin/env python3
from sympy import symbols, sqrt, plot

print('8.')

x = symbols('x')
y1 = sqrt(1 - x ** 2)
y2 = sqrt(9 * (1 - x ** 2 / 4))

p = plot(*[sign * y
           for y in [y1, y2]
           for sign in [-1, 1]],
         (x, -5, 5),
         ylim=(-5, 5),
         legend=True,
         show=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
          'purple', 'pink', 'gray', 'skyblue', 'yellow']

for o, color in zip(p, colors):
    o.line_color = color

p.show()
p.save('sample8.png')

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

% ./sample8.py
8.
%

0 コメント:

コメントを投稿