2020年2月18日火曜日

学習環境

解析入門 原書第3版 (S.ラング(著)、松坂 和夫(翻訳)、片山 孝次(翻訳)、岩波書店)の第Ⅵ部(多変数の関数)、第18章(ベクトルの微分)、1(微分係数)の練習問題8の解答を求めてみる。



    1. Xt=cost,sintX't=-sint,costX'π3=-sinπ3,cosπ3=-32,12

      Xπ3=cosπ3,sinπ3=12,32

      における速度ベクトルに垂直なベクトルの1つを求める。

      -32,12·x,y=0-32x+12y=0-3x+y=01,3

      よって、求める法線の方程式は、

      X=12,32+t1,3

    2. Xt=cos3t,sin3tX't=-3sin3t,3cos3tX'π3=-3sinπ,3cosπ=0,-30,-3·x,y=0-3y=0y=0a,0Xπ3=-1,0X=-1,0+t1,0

コード

#!/usr/bin/env python3
from sympy import symbols, sin, cos, Rational, sqrt
from sympy.plotting import plot_parametric, plot_parametric

print('8.')

t = symbols('t')

p = plot_parametric((cos(t), sin(t), (t, -5, 5)),
                    (Rational(1, 2) - sqrt(3) / 2 * t, sqrt(3) /
                     2 + Rational(1, 2) * t, (t, -5, 5)),
                    (Rational(1, 2) + t, sqrt(3) / 2 + sqrt(3) * t, (t, -5, 5)),
                    (-1, -3 * t, (t, -5, 5)),
                    (-1 + t, 0, (t, -5, 5)),
                    legend=True,
                    show=False)


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

for s, color in zip(p, colors):
    s.line_color = color
p.show()
p.save('sample8.png')

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

% ./sample8.py
8.
%

0 コメント:

コメントを投稿