読者です 読者をやめる 読者になる 読者になる

【TikZ】2次元回転行列の導出で用いた図

以前の記事 にTikZで作った図を追加しました.
Texのコードを残しておきます.
f:id:IsThisAPen:20170103224421p:plain

\begin{figure}[htbp]
  % 左の図
  \begin{minipage}{0.3\hsize}
    \begin{center}
      \begin{tikzpicture}[scale=2]
        % 座標軸
        \draw [thick, -stealth](-0.5,0)--(3/2,0) node [anchor=north]{$x$};
        \draw [thick, -stealth](0,-0.5)--(0,3/2) node [anchor=east]{$y$};
        \node [anchor=north east] at (0,0) {O};        
        % 補助線
        \draw [dashed](0,{sqrt(3)/2})--(1/2,{sqrt(3)/2});
        \draw [dashed](1/2,0)--(1/2,{sqrt(3)/2});
        \draw [thin,->](0:1/4) arc (0:60:1/4);
        \node at(40:1/4) [anchor=west]{$\theta$}; %極座標表示:(θ:r)      
        % ベクトル
        \draw [very thick, -stealth, blue](0,0)--(1,0)node [anchor=north]{(1,0)};
        \draw [very thick, -stealth, blue](0,0)--(1/2,{sqrt(3)/2})node [anchor=west]{($\cos\theta,\sin\theta$)};   
      \end{tikzpicture}
    \end{center}
  \end{minipage}
  % 右の図
  \begin{minipage}{0.3\hsize}
    \begin{center}
      \begin{tikzpicture}[scale=2]
        % 座標軸
        \draw [thick, -stealth](-3/2,0)--(1/2,0) node [anchor=north]{$x$};
        \draw [thick, -stealth](0,-0.5)--(0,3/2) node [anchor=east]{$y$};
        \node [anchor=north east] at (0,0) {O};      
        % 補助線
        \draw [dashed](0,1/2)--(-{sqrt(3)/2},1/2);
        \draw [dashed](-{sqrt(3)/2},0)--(-{sqrt(3)/2},1/2);
        \draw [thin,->](90:1/4) arc (90:150:1/4);
        \node at(130:1/4) [anchor=south]{$\theta$}; %極座標表示:(θ:r)   
        % ベクトル
        \draw [very thick, -stealth, red](0,0)--(0,1)node [anchor=west]{(0,1)};
        \draw [very thick, -stealth, red](0,0)--(-{sqrt(3)/2},1/2)node [anchor=east]{($-\sin\theta,\cos\theta$)};     
      \end{tikzpicture}
    \end{center}
  \end{minipage}
\end{figure}