我需要在蓝色的两个向量之间建立一个角度,我无法完全理解我看到的代码,如果有人可以帮助我。
\begin{tikzpicture}[scale=1]
\draw[->] (-1,0)--(5,0) node[right]{$x$};
\draw[->] (0,-1)--(0,5) node[above]{$y$};
\draw[name path=fr1, blue,-stealth,line width = 0.5mm] (0,0) -- (5,2) node[pos=0.5, anchor=south]{$F_1 $};
\draw[name path=fr2, blue,-stealth,line width = 0.5mm] (0.7,4) -- (0,0) node[pos=0.5, anchor=west]{$F_2 $};
\draw[name path=fr3, red,-stealth,line width = 0.5mm] (0.7,4) -- (5,2) node[pos=0.5, anchor=south]{$F_3 $};
\path[name path=circ] (0,0) circle (1);
\draw[red, -, intersection segments = {of= fr1 and fr2, sequence=R1}];
\end{tikzpicture}
答案1
\documentclass{standalone}
\usepackage{tkz-base,tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmax=5,ymax=5]
\tkzDrawXY[noticks]
\tkzDefPoints{0/0/A,5/2/B,0.7/4/C}
\tkzDrawSegments[vector style,blue](A,B C,A)
\tkzDrawSegment[vector style,red](C,B)
\tkzMarkAngle[<->](B,A,C)
\tkzLabelAngle[pos=1.2](B,A,C){$\alpha$}
\tkzLabelSegment[blue](A,B){$F_1$}
\tkzLabelSegment[blue,swap](A,C){$F_2$}
\tkzLabelSegment[red](C,B){$F_3$}
\end{tikzpicture}
\end{document}
答案2
\documentclass[border=5pt,tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles, quotes, intersections}
\begin{document}
\begin{tikzpicture}[scale=1]
\draw[->] (-1,0)--(5,0) node[right]{$x$};
\draw[->] (0,-1)--(0,5) node[above]{$y$};
\draw[name path=fr1, blue,-stealth,line width = 0.5mm] (0,0)coordinate(aux) -- (5,2) node[pos=0.5, anchor=south]{$F_1 $}coordinate(aux1);
\draw[name path=fr2, blue,-stealth,line width = 0.5mm] (0.7,4)coordinate(aux2) -- (0,0) node[pos=0.5, anchor=west]{$F_2 $};
\draw[name path=fr3, red,-stealth,line width = 0.5mm] (0.7,4) -- (5,2) node[pos=0.5, anchor=south]{$F_3 $};
\path[name path=circ] (0,0) circle (1);
\pic[ draw,<->,>=stealth,red!60!black, "$\theta_1$"{fill=white},inner sep=1pt, circle, angle eccentricity=1.1, angle radius = 10mm] {angle = aux1--aux--aux2};
\end{tikzpicture}
\end{document}
答案3
与 @js bibra 答案(+1)类似,但使用quotes
所有边标签的库且不使用intersections
库:
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{angles, arrows.meta,
quotes}
\begin{document}
\begin{tikzpicture}[
> = Straight Barb,
arr/.style = {color=#1, very thick, line cap=round, -Stealth},
every edge quotes/.append style = {auto, sloped}
]
% axis
\draw[->] (-0.5,0)--(5,0) node [right] {$x$};
\draw[->] (0,-0.5)--(0,5) node [above] {$y$};
% vectors
\draw[arr=blue] (0.0,0) coordinate (O) to ["$F_1$"] (5,2);
\draw[arr=blue] (0.7,4) coordinate (f2) to ["$F_2$" '] (0,0);
\draw[arr=red] (0.7,4) to ["$F_3$"] (5,2) coordinate (f3);
% angle
\pic [draw, red, <->,
angle radius = 7mm,
angle eccentricity=1.3,
"$\alpha$"] {angle = f3--O--f2};
\end{tikzpicture}
\end{document}
答案4
使用tzplot
包裹:
\documentclass[tikz]{standalone}
\usepackage{tzplot}[scale=.6]
\begin{document}
\begin{tikzpicture}[font=\scriptsize]
\tzaxes*(-1,-1)(5,5){$x$}{$y$}
\tzcoors(0,0)(aux)(0.7,4)(aux2)(5,2)(aux1);
\tzline[blue,->,line width=0.5mm](aux){$F_1$}[a](aux1)
\tzline[blue,->,line width=0.5mm](aux2){$F_2$}[r](aux)
\tzline[red,->,line width=0.5mm](aux2){$F_3$}[a](aux1)
\tzanglemark[<->](aux1)(aux)(aux2){$\theta_1$}[pos=1,fill=white](1cm)
\end{tikzpicture}
\end{document}