3

enter image description here

\begin{tikzpicture}
     \draw[dashed] (1.9,3)--(4,3);
     \draw[dashed] (4,3)--(4,0);
     \draw[dashed] (2.5,4)--(4,3);
     \draw[dashed] (4,3)--(2,0);
     \draw[very thick,->] (0,0)--(1.5,0) node[below] {$\mathbf{e}_1$};
     \draw [very thick, ->] (0,0)--(0.94,1.5) node[left] {$\mathbf{e}_2$};
     \draw [very thick, red, ->] (0,0)--(4,3) node[midway,below] {$\mathbf{A}$};
     \draw[->] node[below]{$O$} (0,0) --(6,0) node [above] {$m'$};
     \draw[->] (0,0)--(3,4.8) node[above] {$m''$};
     \node at (4.2,3.1) {$M$};
     \node at (1.4,3) {$\boldsymbol{M''}$};
     \node at (2.3,-0.14) {$\boldsymbol{M'}$};
\end{tikzpicture}

enter image description here

Here's the result of my code above, but I'm having two problems I don't know how to draw the angles $\alpha$ and $\beta$ and the thick nodes $M''$ and $M'$.

For those interested in figure it's representing the covariant and contravariant components.

  • @jsbibra Hi! thanks for the comment, note that I've learned only the basics of Tikz a few weeks ago, please consider that! have you a Gmail so I can contact you? – Electroelf 20 hours ago
  • 1
    jsbibra@gmail.com – js bibra 15 hours ago
  • Hi, please give a fully compilable code. – AndréC 15 hours ago
  • @Electroelf -- please have a look at the edit below – js bibra 14 hours ago
8

Any angle is defined by three points which are endorsed below as coordinates

Thereafter the angles are physically drawn with the help of the pic command

Simply add all the code below to your own code to get the desired output

enter image description here

\coordinate(m) at (4,3);
\coordinate(x) at (4,0);
\coordinate(o) at (0,0);
\coordinate(y) at (2.5,4);

\pic[ draw,->,>=stealth,blue, "$\theta_1$"{fill=white},inner sep=1pt, circle,  draw,angle 
eccentricity=1.1, angle radius = 10mm] {angle = m--o--x};   

\pic[ draw,->,>=stealth,blue, "$\theta_2$"{fill=white},inner sep=1pt, circle,  draw,angle 
eccentricity=1, angle radius = 7mm] {angle = y--o--m};

EDIT -- I simply forgot the point nodes required by the OP-- apologies

enter image description here

\documentclass[]{article}
\usepackage{tikz}
\usepackage{newtxtext,newtxmath}

\usetikzlibrary{arrows, shapes, positioning, calc, decorations.text, angles, 
               quotes}
\begin{document}

\begin{tikzpicture}[
                    mycirc/.style={circle,
                                   fill=red!50!black, 
                                   minimum size=5pt,
                                   inner sep=0pt}
                    ]
\draw[dashed] (1.9,3)--(4,3);
\draw[dashed] (4,3)--(4,0);
% The nodes as points or circles are drawn as under--note tha the names of
% the nodes are given in `()` and the same can be used in place of using
% coordinate names
\node[mycirc]at(0,0) (a) {};
\node[mycirc]at(4,0) (b) {};
\node[mycirc]at(2,0) (c) {};
\node[mycirc]at(1.9,3) (d) {};
\node[mycirc]at(4,3) (e) {};
\node[mycirc]at(2.5,4) (f) {};

\draw[dashed] (2.5,4)--(4,3);
\draw[dashed] (4,3)--(2,0);
\draw[very thick,->] (0,0)--(1.5,0) node[below] {$\mathbf{e}_1$};
\draw [very thick, ->] (0,0)--(0.94,1.5) node[left] {$\mathbf{e}_2$};
\draw [very thick, red, ->] (0,0)--(4,3) node[midway,below] {$\mathbf{A}$};
\draw[->] node[below]{$O$} (0,0) --(6,0) node [above] {$m'$};
\draw[->] (0,0)--(3,4.8) node[above] {$m''$};
\node at (4.2,3.1) {$M$};
\node at (1.4,3) {$\boldsymbol{M''}$};
\node at (2.3,-0.14) {$\boldsymbol{M'}$};

%Coordinate names for the angles-- can be deleted and node names can also be 
%used
\coordinate(m) at (4,3);
\coordinate(x) at (4,0);
\coordinate(o) at (0,0);
\coordinate(y) at (2.5,4);

\pic[ draw,->,>=stealth,green!50!yellow!50!red, "$\theta_1$"{fill=white},inner sep=1pt, circle,  draw,angle 
eccentricity=1.1, angle radius = 10mm] {angle = m--o--x};   

\pic[ draw,->,>=stealth,blue, "$\theta_2$"{fill=white},inner sep=1pt, circle,  draw,angle 
eccentricity=1, angle radius = 7mm] {angle = y--o--m};
\end{tikzpicture}

\end{document}

EDIT2 -- for inner angles instead of outer angles

Change the last lines of the code containing the \pic command to--

\pic[ "$\beta$"{fill=white, inner sep=0pt},draw=green!50!yellow!50!red, <->, 
                >=stealth, angle eccentricity=1, angle radius = 1.5cm] 
                {angle = x--o--m};   

    \pic["$\alpha$"{fill=white, inner sep=0pt}, draw=orange, <->, >=stealth, 
               angle eccentricity=1, angle radius=1.5cm]
               {angle = m--o--y};

and you would get--

enter image description here

| improve this answer | |
5

When you want to build a figure, it is easier to give a name to the points you want to use. To do this, I used nodes, because any path from one node to another goes from edge to edge without crossing them. To do this, I defined a style called point like this point/.style={circle,fill,inner sep=1.3pt}

I used the angle library to draw the angles. And I used the calc library to build the orthogonal projections, which avoids having to do manual calculations.

screenshot

 \documentclass[tikz,border=5mm]{standalone}

 \usepackage{amsmath}
 \usetikzlibrary{arrows,angles,calc,quotes}

\begin{document}
\begin{tikzpicture}[
point/.style={circle,fill,inner sep=1.3pt}
]
\node[point,label={[below left,yshift=-2pt]:$O$}] (O) at (0,0){}; 
\node [point,label={[above right,yshift=-2pt]:$\boldsymbol{M}$}](M) at (4,3){};
\node [point,label={[below,yshift=-2pt]:$\boldsymbol{M'}$}](M') at (2,0){};
\node [point,label={[left]:$\boldsymbol{M''}$}](M'') at (1.9,3){};
\draw[dashed] (M'')--(M)--(M');
\draw[dashed] (M)--($(O)!(M)!(M')$); % projection orthogonale de M sur (OM')
\draw[dashed] ($(O)!(M)!(M'')$)--(M);% projection orthogonale de M sur (OM'')
%     \draw[dashed] (4,3)--(2,0);
\draw[very thick,->] (O)--(1.5,0) node[below] {$\mathbf{e}_1$};
\draw [very thick, ->] (O)--(0.94,1.5) node[left] {$\mathbf{e}_2$};
\pic [draw=violet,fill=violet!30,text=violet!60!black,angle radius=8mm,"$\beta$",angle eccentricity=1.3]{angle=M'--O--M};
\pic [draw=blue,fill=blue!40,text=blue,angle radius=9mm,"$\alpha$",angle eccentricity=1.3]{angle=M--O--M''};
\draw [very thick, red, ->] (O)--(M) node[midway,below] {$\mathbf{A}$};
\node[point] at (O){};% We place again the point  O     \draw[->] (O) --(6,0) node [above] {$m'$};
\draw[->] (O)--(3,4.8) node[above] {$m''$};
%     \node at (4.2,3.1) {$M$};
%     \node at (1.4,3) {$\boldsymbol{M''}$};
%     \node at (2.3,-0.14) {$\boldsymbol{M'}$};
\end{tikzpicture}
\end{document}
| improve this answer | |
  • Hi, can you sent the dot of O above? I see the violet arc in the dot. Same for the arrows e_1 and e_2. Thank you. – Sebastiano 8 hours ago
  • 1
    @Sebastiano There, it's done. – AndréC 6 hours ago
  • Oh, thank you...I have forgot...."please"...For my opinion now it is better instead of first answer. – Sebastiano 5 hours ago
  • I had noticed, but if the OP doesn't ask for it, why would I change it? As you requested, I did. :-) – AndréC 2 hours ago
  • 1
    No, on the contrary, it's nice to see that someone is interested in what we're doing. – AndréC 33 mins ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.