%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simple Pendulum
% Author: Gabriel Pereira Coelho
% Email: gabrielufopalimf@gmail.com
% Publication Date: July 16, 2023
% University: Universidade Federal do oeste do Pará
% If you use this work, please reference it.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{patterns}
\tikzset{
support/.style={
pattern=north east lines,
draw=none,
minimum width=0.3,
minimum height=0.6
}
,>=latex
}
\begin{document}
\begin{tikzpicture}
% Coordinates
\coordinate (A) at (-1.5,0);
\coordinate (B) at (1.5,0);
\coordinate (C) at (0,2);
% Axes
\draw[->,dashed,gray] (-2,0) -- (2,0);
\draw[->,dashed, gray] (0,2) -- (0,-2) node[coordinate] (O) {};
% Support
\draw (-0.5,2) -- (0.5,2);
\draw[support] (-0.5,2) rectangle++ (1,0.25);
% Coordinate markings (To draw angles and enclose vectors with dashed lines)
\draw[->] (A) -- ++(270:1.25) node[coordinate] (R) {};
\draw[->] (A) -- ++(233.2:1) node[coordinate] (P) {};
\draw[->] (A) -- ++(-36:0.75) node[coordinate] (Q) {};
% Lines and vectors
\draw[dashed, gray] (C) -- ++(306.8:2.5);
\draw (C) -- ++(233.2:2.5);
\draw[->] (A) -- ++(233.2:1) node[below,rotate=-30]{\tiny{$P_y$}};
\draw[->] (A) -- ++(53.2:1) node[right,rotate=-30]{\tiny{$T$}};
\draw[->] (A) -- ++(-36:0.75) node[right,rotate=-30]{\tiny{$P_x$}};
\draw[->] (A) -- ++(270:1.25) node[below,rotate=10]{\tiny{$P$}};
\draw[dashed,gray] (P) -- (R) -- (Q);
% Coordinate markings (To draw angles)
\draw[->] (A) -- ++(270:1.25) node[coordinate] (R) {};
\draw[->] (A) -- ++(233.2:1) node[coordinate] (P) {};
\draw[->] (A) -- ++(-36:0.75) node[coordinate] (Q) {};
% Angles
\tkzMarkAngle[-, size=0.5](A,C,O)
\tkzLabelAngle[pos=0.6](A,C,O){\tiny{$\theta$}}
\tkzMarkAngle[-, size=0.5](P,A,R)
\tkzLabelAngle[pos=0.6](P,A,R){\tiny{$\theta$}}
% Pendulum trajectory
\draw (-1.5,0) .. controls (-1,-0.5) and (1,-0.5) .. (1.5,0);
% Circles
\draw[fill = black] (A) circle (4pt);
\draw[dashed] (B) circle (4pt);
\end{tikzpicture}
\end{document}