0

I am a complete beginner to Tikz but this is what I have so far:

\begin {tikzpicture} [scale=3]
\draw [<->, thick] (0,2) node (yaxis) [above] {$i$}
|- (3,0) node (xaxis) [right] {$Y$};

\draw (0,0) coordinate (a_1) -- (2,1.8) coordinate (a_2);
\draw (0,1.5) coordinate (b_1) -- (2.5,0) coordinate (b_2);
    
\end{tikzpicture}

I would like a theta that corresponds to the angle between the upwards sloping line and the x-axis as shown below. (Ignore the other differences I am only interested in the theta element of the second picture). The arc around the theta also needs to be able fit if in the same manner if the slope of the line changes.

enter image description here

2
  • 1
    Hello, and welcome to TeX-SE. This kind of question has been answered in various ways, you can find a solution here, for example: tex.stackexchange.com/questions/278282/…
    – SebGlav
    Jan 10, 2021 at 22:15
  • @HenryM were you able to complete the plot
    – js bibra
    Jan 11, 2021 at 3:29

1 Answer 1

2

Here's a working example:

Angle Theta

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{angles,quotes}
\begin{document}

\begin{tikzpicture} [scale=3]
    
    \coordinate (a_1) at (0,0);
    \coordinate (a_2) at (2,1.8);
    \coordinate (b_1) at (0,1.5);
    \coordinate (b_2) at (2.5,0);
    
    \draw pic[draw,fill=blue!30,angle radius=1.2cm,"$\theta$" shift={(2mm,1mm)}] {angle=b_2--a_1--a_2};
    
    \draw (a_1) -- (a_2);
    \draw (b_1) -- (b_2);
    
    \draw [<->, thick] (0,2) node (yaxis) [above] {$i$}
    |- (3,0) node (xaxis) [right] {$Y$};
    
\end{tikzpicture}

\end{document}

Since the angle is a pic by itself, you may want to draw it before drawing axis and lines. It's better looking like that.
Another way to achieve this very easily is to use the tkz-euclide library.

The arc around the theta also needs to be able fit if in the same manner if the slope of the line changes.

I don't really understand what you mean by that, you may be more specific.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .