tikzで三角形の辺の長さを書き込みたいとき
midwayで書き込むことはいろんなページで説明されているが、書き込む長さが5cmとかだと、少し位置を調整したい時がある。
位置を調整するのが
anchor=east
とかなので、midwayの代わりにanchor=eastを書いたりしてうまくいかない感じになっていたが、どちらも書くことで求める図が記述できた。
midwayのみの時の図(5cmが重なってしまっている、これを少し右に移動させたい。
)
完成図形
\begin{tikzpicture}
\path(0,0) node[name=o]{};
\path(0:{sqrt(3)*4}) node[name=a]{};%{sqrt(3)}*4とするとエラーが出るので注意
\path(30:2*4) node[name=b]{};
\huge
\path pic[draw,"$\SI{30}{\degree}$",angle eccentricity=2,angle radius=25pt]{angle=a--o--b};
\path pic[draw,"",angle eccentricity=2]{right angle=b--a--o};
\path [draw,dashed] (o) to[out=60,in=180,edge node={node [midway,fill=white]{ここの長さは?}}](b);
\path [draw,dashed] (a) to[out=60,in=300,edge node={node [midway,anchor=mid west,fill=white]{$\SI{5}{\centi\meter}$}}](b);
%\path[draw,arrows=-stealth,color=red,line width=3pt] (0,0) --(0:4) node[anchor=north east] {$\overrightarrow{a}$};
%\path[draw,arrows=-stealth,color=blue,line width=3pt] (0,0) --(180:5) node[anchor=east] {$\overrightarrow{b}$};
\path[draw,line width=2pt] (0,0) --(30:2*4) --(0:{sqrt(3)*4}) --(0,0);
\end{tikzpicture}