我需要从正 x 轴绘制一个 theta 角,逆时针旋转直到找到 FR 矢量。下面的代码是我已经知道如何做的,但我对这个角度有困难。
\documentclass[border=5pt,tikz]{standalone}
\begin{tikzpicture}[scale=0.5]
\draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
\draw[->] (-5,0)--(5,0) node[right]{$x$};
\draw[->] (0,-5)--(0,5) node[above]{$y$};
\draw[blue,->,line width = 0.25mm] (0,0) -- (-2.7,-4.8) node[left]{$FR$};
\end{tikzpicture}
答案1
fillbetween
您可以使用pgfplots
(参见https://tex.stackexchange.com/a/239471/47927)。
您需要为要抓取交叉点的路径命名name path=
。然后使用选项绘制一条新路径intersection segments
,并说明您之前指定的路径名称。最后,您需要说明sequence
要绘制哪个路径。L1
这里的意思是您想要语句左侧的路径的第一段of
(即circ
此处)。
\documentclass[border=5pt,tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{fillbetween}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
\draw[->] (-5,0)--(5,0) node[right]{$x$};
\draw[->] (0,-5)--(0,5) node[above]{$y$};
\draw[name path=fr, blue,->,line width = 0.25mm] (0,0) -- (-2.7,-4.8) node[left]{$FR$};
\path[name path=circ] (0,0) circle (3);
\draw[red, ->, intersection segments={of=circ and fr, sequence=L1}];
\node[red] at (120:2.5) {$\theta$};
\end{tikzpicture}
\end{document}
答案2
\documentclass[border=5pt,tikz]{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{angles, quotes}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\draw[help lines, color=gray!30, dashed] (-4.9,-4.9) grid (4.9,4.9);
\draw[->] (-5,0)--(5,0) node[right,coordinate,label=right:$x$](x){};
\draw[->] (0,-5)--(0,5) node[above]{$y$};
\draw[blue,->,line width = 0.25mm] (0,0)coordinate(o) -- (-2.7,-4.8) node[left, coordinate,label=below:$FR$](fr){};
\pic[ draw,->,>=stealth,red!60!black, "$\theta_1$"{fill=white},inner sep=1pt, circle, angle eccentricity=1.1, angle radius = 10mm] {angle = x--o--fr};
\end{tikzpicture}
\end{document}
答案3
使用tzplot
包裹:
\documentclass[tikz]{standalone}
\usepackage{tzplot}
\begin{document}
\begin{tikzpicture}
\tzhelplines(-4.9,-4.9)(4.9,4.9)
\tzaxes(-5,-5)(5,5){$x$}{$y$}
\tzcoors(0,0)(O)(-2.7,-4.8)(P);
% \theta
\tzline[blue,->,line width = 0.25mm](O)(P){$FR$}[l]
\tzanglemark[red,->](O-|1,0)(O)(P){$\theta$}[pos=.9](2cm)
% \theta_1
\tzline[->](O)(3,2)
\tzanglemark[red,->](O-|1,0)(O)(3,2){$\theta_1$}(8mm)
\end{tikzpicture}
\end{document}