# How can I draw quickly using tikz?

I've already asked about how can I draw a similar figure as this one using TikzI just learned the basics of this fascinating library, but I really want to draw complex figures using simple codes :

Drawing this figure (I didn't achieved it yet) took me one hour !

\begin{tikzpicture}[scale=1.5]
\draw[smooth, dashed] (7,-2.15)--(6.5,-2.15);
\draw[smooth] (7.5,-3) arc (0:90:0.989);
\draw[smooth ,dashed] (6.5,-2)--(6.5,-3)--(7.5,-3) node[right] {$D$};
\draw[smooth] (6.5,-3)--(7,-2.15)node[below, midway] {$r$} node[above]{$M$};
\coordinate(x) at (7,-2.15);
\coordinate(y) at (6.5,-3);
\coordinate(z) at (6.5,-2);
\pic [draw=black!15!black,text=black,angle radius=5mm,"$\theta$",angle eccentricity=1.3]{angle = x--y--z};

\end{tikzpicture}


Can anyone show me where to find a good book or youtube channel so I can learn more, and yeah I'd be thankful if someone achieved my work. Thanks in advance !

• Welcome! The asnwer, I fear, is that the only solution is practice --- when you'll have drawn 100 figures like the one you show here, you'll need 5 minutes. There are online tools to draw TikZ diagrams without coding, see tex.stackexchange.com/a/421731/38080, but if you want to reuse the diagrams and use higher level options I recommend just practice. Commented Mar 19, 2021 at 17:28

A solution in plain TikZ. Your work is already in the right path, you would learn fast from what is posted here. I strongly encourage you to look at the tkz-euclide package if you want to draw more easily this kind of graphics.

EDIT: I edited the code to let you scale your figure by choosing the value of \rand allow the rest of the distances to be automatically calculated (not including the line width).

\documentclass[tikz,border=3.141592mm]{standalone}
\usetikzlibrary{calc,positioning}

\begin{document}
\begin{tikzpicture}
\def\t{25}  % Theta
\def\d{2*\r/5}  % distance for Theta angle mark

\draw (0,0) coordinate (O) -- (\r,0) coordinate (D) arc (0:90:\r) coordinate (C) -- cycle;
\draw (0,0) -- (90-\t:\r) coordinate (M) node [midway,right] {$r$};
\draw (0,\d) arc (90:90-\t:\d) node [midway,above] {$\theta$};

\node [below left] at (O) {$O$};
\node [below right] at (D) {$D$};
\node [above left] at (C) {$C$};
\node [above left=3pt and -5pt] at (M) {$M$};

% Vectors
\begin{scope}[line width=1.5pt,-stealth]
\draw[red] (M) --++ (0,-3*\r/5) node [midway,right] {$\vec{P}$};
\draw[olive] (M) -- ($(M)+(-\t:\r/2)$) node [midway,above] {$\vec{u}$};
\draw[olive] (M) -- ($(M)!0.4!(O)$) node [midway,left] {$\vec{n}$};

\draw[blue] (M) -- ($(M)!-0.5!(O)$) node [midway,left] {$\vec{R}$};

\end{scope}
\def\angledist{0.05*\r} % distance for right angle
\draw[olive,line width=1pt] (M)--++ (-90-\t:\angledist) --++ (-\t:\angledist) --++ (90-\t:\angledist);

\end{tikzpicture}
\end{document}


• I just edited my post to change a bit into the code, just to let you adjust the radius and not be obliged to manually adjust other lengths. Now everything (except line width) is automatic. Commented Mar 19, 2021 at 20:47
\begin{tikzpicture}[scale=1.5]
% Draw the coordinate axes
\draw[->] (-1,0) -- (3,0) node[anchor=north west] {x};
\draw[->] (0,-2) -- (0,1) node[anchor=south east] {y};
% Draw the vector r
\draw[->, thick] (0,0) -- (2.5,0) node[anchor=north east] {$\vec{r} = d$};
% Draw the force vector F
\draw[->, thick] (2.5,0) -- (2.5,-1.5) node[anchor=south west] {$\vec{F}$};
% Mark the points
\filldraw (0,0) circle (2pt) node[anchor=north east] {O (ponto de rotação)};
\filldraw (2.5,0) circle (2pt) node[anchor=north west] {A};
% Add labels for the lengths
\node[anchor=north] at (1.25, 0) {$d = 0.25 \, \text{m}$};
\node[anchor=east] at (2.5,-0.75) {$F = 539 \, \text{N}$};
\end{tikzpicture}