5

I need to draw a theta angle from the positive x-axis, going around counterclockwise until I find the FR vector. The code below is what I already knew how to do, but I'm having difficulty with this angle.

\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}

3 Answers3

5

You can make use of the fillbetween library that comes with pgfplots (See https://tex.stackexchange.com/a/239471/47927).

You need to name the paths of which you want to grab the intersections with name path=. Then you draw a new path with the option intersection segments and state the names of the pathes you previously assigned. You finally need to state which sequence you want to draw. L1 here means that you want the first segment of the path that is on the left side of the of statement (which is circ here).

\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}

enter image description here

5

enter image description here

\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}

js bibra
  • 21,280
1

Using the tzplot package:

enter image description here

\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 \tzlineblue,->,line width = 0.25mm(P){$FR$}[l] \tzanglemarkred,->(O)(P){$\theta$}pos=.9 % \theta_1 \tzline->(3,2) \tzanglemarkred,->(O)(3,2){$\theta_1$}(8mm) \end{tikzpicture}

\end{document}

I. Cho
  • 2,985