2017年7月12日水曜日

学習環境

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の5章(線形写像と行列)、3(線形写像の合成)、練習問題8.を取り組んでみる。


  1. F θ F θ ' =( cosθ sinθ sinθ cosθ )( cosθ' sinθ' sinθ' cosθ' ) =( cosθcos θ sinθsinθ' cosθsinθ'sinθcos θ sinθcosθ'+cosθsinθ' sinθsinθ'+cosθcos θ ) =( cos( θ+ θ ) sin( θ+θ' ) sin( θ+ θ ) cos( θ+ θ ) ) = F θ+ θ

    F θ F θ =( cosθ sinθ sinθ cosθ )( cos( θ ) sin( θ ) sin( θ ) cos( θ ) ) =( cosθcos( θ )sinθsin( θ ) cosθsin( θ )sinθcos( θ ) sinθcos( θ )+cosθsin( θ ) sinθsin( θ )+cosθcos( θ ) ) =( cosθcosθ+sinθsinθ sinθcosθcosθsinθ sinθcosθcosθsinθ sinθsinθ+cosθcosθ ) =( cos( θθ ) sin( θθ ) sin( θθ ) cos( θθ ) ) =( cos0 sin0 sin0 cos0 ) =( 1 0 0 1 )

  2. X=( x,y ) F θ ( X )=( xcosθysinθ xsinθ+ycosθ ) X = x 2 + y 2 F θ ( X ) = ( xcosθysinθ ) 2 + ( xsinθ+ycosθ ) 2 = x 2 cos 2 θ+ y 2 sin 2 θ2xy sin 2 θ+ x 2 sin 2 θ+ y 2 cos 2 θ+2xysinθcosθ = x 2 ( sin 2 θ+ cos 2 θ )+ y 2 ( sin 2 θ+ cos 2 θ ) = x 2 + y 2

    1. id( 1,1,0 )= ( 1,1,0 ) t = a 11 ( 2 1 1 )+ a 21 ( 0 0 1 )+ a 31 ( 1 1 1 ) id( 1,1,1 )= ( 1,1,1 ) t = a 12 ( 2 1 1 )+ a 22 ( 0 0 1 )+ a 32 ( 1 1 1 ) id( 0,1,2 )= ( 0,1,2 ) t = a 13 ( 2 1 1 )+ a 23 ( 0 0 1 )+ a 33 ( 1 1 1 ) 2 a 11 a 31 =1 a 31 =2 a 11 1 a 11 +2 a 11 1=1 a 11 = 2 3 a 31 = 1 3 2 3 + a 21 + 1 3 =0 a 21 =1 2 a 12 a 32 =1 a 32 =2 a 12 +1 a 12 +2 a 12 +1=1 a 12 =0 a 32 =1 a 22 +1=1 a 22 =0 2 a 13 a 33 =0 a 33 =2 a 13 a 13 +2 a 13 =1 a 13 = 1 3 a 33 = 2 3 1 3 + a 23 + 2 3 =2 a 23 =1 ( 2 3 0 1 3 1 0 1 1 3 1 2 3 )

    2. id( 3,2,1 )= ( 3,2,1 ) t = a 11 ( 1 1 0 )+ a 21 ( 1 2 4 )+ a 31 ( 2 1 1 ) id( 0,2,5 )= ( 0,2,5 ) t = a 12 ( 1 1 0 )+ a 22 ( 1 2 4 )+ a 32 ( 2 1 1 ) id( 1,1,2 )= ( 1,1,2 ) t = a 13 ( 1 1 0 )+ a 23 ( 1 2 4 )+ a 33 ( 2 1 1 ) a 11 a 21 +2 a 31 =3 a 11 = a 21 2 a 31 +3 a 21 2 a 31 +3+2 a 21 a 31 =2 3 a 21 3 a 31 =1 a 31 = a 21 + 1 3 a 11 = a 21 2 a 21 2 3 +3= a 21 + 7 3 4 a 21 + a 21 + 1 3 =1 5 a 21 = 2 3 a 21 = 2 15 a 11 = 2 15 + 7 3 = 33 15 a 31 = 2 15 + 1 3 = 7 15 a 12 a 22 +2 a 32 =0 a 12 = a 22 2 a 32 a 22 2 a 32 +2 a 22 a 32 =2 3 a 22 3 a 32 =2 a 22 = a 32 2 3 a 12 = a 32 2 3 2 a 32 = a 32 2 3 4 a 32 8 3 + a 32 =5 a 32 =1+ 8 15 = 23 15 a 12 = 23 15 2 3 = 33 15 a 22 = 23 15 2 3 = 13 15 a 13 a 23 +2 a 33 =1 a 13 = a 23 2 a 33 +1 a 23 2 a 33 +1+2 a 23 a 33 =1 3 a 23 3 a 33 =0 a 33 = a 23 a 13 = a 23 2 a 23 +1= a 23 +1 4 a 23 + a 23 =2 a 23 = 2 5 a 33 = 2 5 a 13 = 3 5 ( 33 15 33 15 3 5 2 15 13 15 2 5 7 15 23 15 2 5 )

コード(Emacs)

Python 3

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sympy import pprint, symbols, Matrix, sin, cos, Rational

print('1.')
Θ, Θ1 = symbols('Θ Θ1')

M = Matrix([[cos(Θ), -sin(Θ)],
            [sin(Θ), cos(Θ)]])
M1 = M.subs({Θ: Θ1})

A = M * M1
B = M.subs({Θ: Θ + Θ1})
pprint(A)
pprint(B)

print('2.')
x, y = symbols('x y')
X = Matrix([x, y])
a = (M * X).norm()
b = X.norm()
pprint(a)
pprint(b)

入出力結果(Terminal, IPython)

$ ./sample1.py
1.
⎡-sin(Θ)⋅sin(Θ1) + cos(Θ)⋅cos(Θ1)  -sin(Θ)⋅cos(Θ1) - sin(Θ1)⋅cos(Θ)⎤
⎢                                                                  ⎥
⎣sin(Θ)⋅cos(Θ1) + sin(Θ1)⋅cos(Θ)   -sin(Θ)⋅sin(Θ1) + cos(Θ)⋅cos(Θ1)⎦
⎡cos(Θ + Θ1)  -sin(Θ + Θ1)⎤
⎢                         ⎥
⎣sin(Θ + Θ1)  cos(Θ + Θ1) ⎦
2.
   _________________________________________________
  ╱                      2                        2 
╲╱  │x⋅sin(Θ) + y⋅cos(Θ)│  + │x⋅cos(Θ) - y⋅sin(Θ)│  
   _____________
  ╱    2      2 
╲╱  │x│  + │y│  
$

0 コメント:

コメントを投稿

Comments on Google+: