実習：平面の線形変換

1. 点pを動かしたときの像

A:=(({{1, 2}, {3, 4}}));
Manipulate[
Show[
Graphics[{Arrow[{{-10,0},{10,0}}],Arrow[{{0,-10},{0,10}}]},PlotRange->{{-10,10},{-10,10}}],
Graphics[{
{PointSize[Large],Point[{p[[1]],p[[2]]}]},
Text["p",{p[[1]],p[[2]]}+{0,0.5}],
{PointSize[Large],Point[A.{p[[1]],p[[2]]}]},
Text["Ap",A.{p[[1]],p[[2]]}+{0,-0.7}],
Text[A,{-8,8}],
Text[(({{p[[1]]}, {p[[2]]}}))↦A.(({{p[[1]]}, {p[[2]]}})),{6,8}]
}]
],
{{p,{0,0},"pの座標"},{-3,-3},{3,3}},SaveDefinitions->True, ControlPlacement->Left]

2. 一般形

「お」のデータ

Oten:={
{{3.375,3.375},{3.625,3.625}},
{{3.625,3.625}, {4.625,2.625}},
{{4.625,2.625}, {4.375,2.375}},
{{4.375,2.375},{3.375,3.375}}
};
Oo:={
{{0.5,3.375},{0.5,3.625}},
{{0.5,3.625},{1.375,3.625}},
{{1.375,3.625},{1.375,4.5}},
{{1.375,4.5},{1.625,4.5}},
{{1.625,4.5},{1.625,3.625}},
{{1.625,3.625},{2.5,3.625}},
{{2.5,3.625},{2.5,3.375}},
{{2.5,3.375},{1.625,3.375}},
{{1.625,3.375},{1.625,2}},
{{1.625,2},{3.5,2.625}},
{{3.5,2.625},{4.625,1.5}},
{{4.625,1.5},{3.625,0.375}},
{{3.625,0.375},{3.375,0.625}},
{{3.375,0.625},{4.2,1.5}},
{{4.2,1.5},{3.4,2.325}},
{{3.4,2.325},{1.625,1.67}},
{{1.625,1.67},{1.625,0.5}},
{{1.625,0.5},{1.375,0.5}},
{{1.375,0.5},{0.5,1.375}},
{{0.5,1.375},{0.5,1.625}},
{{0.5,1.625},{1.375,1.925}},
{{1.375,1.925},{1.375,3.375}},
{{1.375,3.375},{0.5,3.375}}
};
Onaka:={
{{0.9,1.45},{1.375,1.625}},
{{1.375,1.625},{1.375,1}},
{{1.375,1},{0.9,1.45}}
};
waku:={
{{0,0},{0,5}},
{{0,5},{5,5}},
{{5,5},{5,0}},
{{5,0},{0,0}}
}

「お」の描画

Graphics[{Line[Oten],Line[Oo],Line[Onaka],Line[waku]}]

「お」を線型変換する

M[a_,b_,c_,d_]:=(({{a, b}, {c, d}}));
Manipulate[
Show[
Graphics[{Arrow[{{-20,0},{20,0}}],Arrow[{{0,-20},{0,20}}]}],
Graphics[{Line[Oten],Line[Oo],Line[Onaka],Line[waku]}],
Graphics[{Thick,Blue,{Line[Oten.Transpose[M[a,b,c,d]]],Line[Oo.Transpose[M[a,b,c,d]]],Line[Onaka.Transpose[M[a,b,c,d]]],Line[waku.Transpose[M[a,b,c,d]]]}}],
Graphics[Text[M[a,b,c,d],{-15,15}]]
],
{{a,1,"(1,1) 成分"},-2,2},{{b,0,"(1,2) 成分"},-2,2},
{{c,0,"(2,1) 成分"},-2,2},{{d,1,"(2,2) 成分"},-2,2},
SaveDefinitions->True, ControlPlacement->Left]

3. 回転

R[s_]:=(({{Cos[s], -Sin[s]}, {Sin[s], Cos[s]}}));
Manipulate[
Show[
Graphics[{Arrow[{{-10,0},{10,0}}],Arrow[{{0,-10},{0,10}}]}],
Graphics[{Line[Oten],Line[Oo],Line[Onaka],Line[waku]}],
Graphics[{Thick,Blue,
{Line[Oten.Transpose[R[s]]],Line[Oo.Transpose[R[s]]],
Line[Onaka.Transpose[R[s]]],Line[waku.Transpose[R[s]]]}
}]
],{s,0,2Pi},SaveDefinitions->True]

4. 鏡映

S[s_]:=(({{Cos[s], Sin[s]}, {Sin[s], -Cos[s]}}));
Manipulate[
Show[
Graphics[{Arrow[{{-10,0},{10,0}}],Arrow[{{0,-10},{0,10}}]}],
Graphics[{Line[Oten],Line[Oo],Line[Onaka],Line[waku]}],
Graphics[{Thick,Blue,
{Line[Oten.Transpose[S[s]]],Line[Oo.Transpose[S[s]]],
Line[Onaka.Transpose[S[s]]],Line[waku.Transpose[S[s]]]}
}],
Graphics[{Thick,Red,Line[{10*{Cos[s/2],Sin[s/2]},10*{-Cos[s/2],-Sin[s/2]}}]}]
],{s,0,2Pi},SaveDefinitions->True]