2020年5月30日土曜日

学習環境

新装版 数学読本3 (松坂 和夫(著)、岩波書店)の第11章(立体的な広がりの中の図形 - 空間図形)、11.3(直線・平面・球の方程式)、2直線の交点、2直線に直交する直線の問26の解答を求めてみる。



    1. 求める直線 AB と直線 l、 m との交点をそれぞれ

      A3s+4,2s+3,sBt-6,-t+7,t

      とおく。

      このとき、

      AB=-3s+t-10,-2s-t+4,-s+t
      {-3s+t-10,-2s-t+4,-s+t·3,2,1=0-3s+t-10,-2s-t+4,-s+t·1,-1,1=0
      {-14s+2t=22-2s+3t=14
      {-7s+t=11-2s+3t=14
      {-21s+3t=33-2s+3t=14
      -19s=19s=-1t=4

      よって、 点 A、 B の座標はそれぞれ、

      A1,1,-1B-2,3,4

      また、 直線 AB の方程式は、

      x-1-3=y-12=z+15

    2. A2s+1,3s-1,s+9Bt+2,4t+2,-2t+14
      AB=t-2s+1,4t-3s+3,-2t-s+5
      {2t-4s+2+12t-9s+9-2t-s+5=0t-2s+1+16t-12s+12+4t+2s-10=0
      {12t-14s=-1621t-12s=-3
      {6t-7s=-87t-4s=-1
      {24t-28s=-3249t-28s=-7
      25t=25t=17-4s=-1s=2
      A5,5,11B3,6,12
      x-52=y-5-1=z-11-1

コード

#!/usr/bin/env python3
from sympy import symbols
from sympy.plotting import plot3d_parametric_line

print('26.')

t = symbols('t')

for i, o in enumerate([[(4 + 3 * t, 3 + 2 * t, t),
                        (t - 6, -1 * t + 7, t),
                        (-3 * t + 1, 2 * t + 1, 5 * t - 1)],
                       [(2 * t + 1, 3 * t - 1, t + 9),
                        (t + 2, 4 * t + 2, -2 * t + 14),
                        (2 * t + 5, -1 * t + 5, -1 * t + 11)]], 1):
    p = plot3d_parametric_line(
        *[(*xyz, (t, -10, 10))
          for xyz in o],
        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.save(f'sample26_{i}.png')

p.show()

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

% ./sample26.py
26.
%

0 コメント:

コメントを投稿