2020年3月7日土曜日

学習環境

新装版 数学読本3 (松坂 和夫(著)、岩波書店)の第9章(図形と代数の交錯する世界 - 平面上のベクトル)、9.2(ベクトルの応用)、直線の方程式の問33の解答を法線ベクトルを考えて求めてみる。


  1. aa=4,-316+9=45,-35bb=5,1225+144=513,1213bb-aa=2565,6065-5265,-3965=-2765,9965

    よって、 求める角 AOB の二等分線の方程式は、

    -2765x+9965y=0y=2799x=311x

コード

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

print('33-1.')

x, t = symbols('x, t')

p = plot(-3 * x / 4,
         12 * x / 5,
         3 * x / 11,
         (x, -5, 5),
         ylim=(-5, 5),
         legend=True, show=False)
p.append(plot_parametric(Rational(25, 66) - Rational(27, 65) * t,
                         Rational(60, 65) + Rational(99, 65) * t,
                         legend=True,
                         show=False)[0])

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(f'sample33_1.png')

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

% ./sample33_1.py
33-1.
%

0 コメント:

コメントを投稿