TikZ:绘制角度到矢量

TikZ:绘制角度到矢量

我需要从正 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}

相关内容