显示了图表的图像,我的目的是让它显示 CM,但不确定如何做。
代码如下所示:
\begin{wrapfigure}{r}{3.2cm}
\begin{tikzpicture}[>=latex',scale=1.425]
% save length of g-vector and theta to macros
\pgfmathsetmacro{\Gvec}{1.5}
\pgfmathsetmacro{\myAngle}{30}
% calculate lengths of vector components
\pgfmathsetmacro{\Gcos}{\Gvec*cos(\myAngle)}
\pgfmathsetmacro{\Gsin}{\Gvec*sin(\myAngle)}
\coordinate (centro) at (0,0);
\draw[dashed,gray,-] (centro) -- ++ (0,-3.5) node (mary) [black,below]{$ $};
\draw[thick] (centro) -- ++(270+\myAngle:3) coordinate (bob);
\pic [draw, ->, "$\theta$", angle eccentricity=1.5] {angle = mary--centro--bob};
\draw [blue, -stealth] (bob) -- ($(bob)!\Gcos cm!(centro)$);
\draw [-stealth] (bob) -- ($(bob)!-\Gcos cm!(centro)$)
coordinate (gcos)
node[midway,above right] {$mg\cos\theta$};
\draw [-stealth] (bob) -- ($(bob)!\Gsin cm!90:(centro)$)
coordinate (gsin)
node[midway,above left] {$mg\sin\theta$};
\draw [-stealth] (bob) -- ++(0,-\Gvec)
coordinate (g)
node[near end,left] {$mg$};
\pic [draw, ->, "$\theta$", angle eccentricity=1.5] {angle = g--bob--gcos};
\end{tikzpicture}
\captionof{figure}{Free body diagram of physical pendulum (author's own)}
\end{wrapfigure}