如何在蓝色箭头上添加未知力的文字?

如何在蓝色箭头上添加未知力的文字?

我想在未知力(蓝色箭头)上添加 F_P,但我不知道如何做。

 \begin{wrapfigure}{r}{3.2cm}   
\begin{tikzpicture}[>=latex',scale=1.5]
% 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=2.3] {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}

在此处输入图片描述

答案1

@Qrrbrbirlbel 和 @John Krmylo 已经给出了很好的评论。我会为您简单输入,并添加必要的代码,使您的 MWE 可编译。

\documentclass[a4paper]{article}
\usepackage{xcolor,tikz}
\usetikzlibrary{arrows,angles,quotes,calc}


\begin{document}
\begin{tikzpicture}[>=latex',scale=1.5]
% 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=2.3] {angle = mary--centro--bob};
\draw [blue, -stealth] (bob) -- ($(bob)!\Gcos cm!(centro)$)
  node[midway,above right] {$F_P$};
\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}
\end{document}

结果

相关内容