Skip to content

lin-ion/latex-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

latex-assets

This is a repository for storing TikZ code for creating diagrams.

Sample

\usetikzlibrary{arrows.meta, angles, quotes}
\begin{tikzpicture}
% variables
\pgfmathsetmacro{\vRadius}{3}
\pgfmathsetmacro{\vPhi}{25}
\pgfmathsetmacro{\vTheta}{40}
\draw[->] (0,0) -- (4,0) node[right] {$x$};
\draw[->] (0,0) -- (0,-4) node[below] {$y$};
\coordinate (O) at (0,0);
\coordinate (A) at ({\vRadius*cos(\vPhi)},{-\vRadius*sin(\vPhi)});
\coordinate (B) at ({\vRadius*cos(\vPhi+\vTheta)},{-\vRadius*sin(\vPhi+\vTheta)});
\fill (A) circle (1.5pt);
\fill (B) circle (1.5pt);
\draw[-] (O) -- (A) node[below right] {$(x_1,y_1)$};
\draw[-] (O) -- (B) node[below right] {$(x_2,y_2)$};
\draw[dashed] (A |- O) node[above] {$x_1$} -- (A) -- (A -| O) node[left] {$y_1$};
\draw[dashed] (B |- O) node[above] {$x_2$} -- (B) -- (B -| O) node[left] {$y_2$};
\pic [draw,{{Stealth[length=6pt]}-},"$\theta$",angle radius=2cm,angle eccentricity=1.2] {angle=B--O--A};
% \node[inner sep=0pt,anchor=north west,opacity=0.3] at (0,0)
% {\includegraphics[width=4cm]{image.png}};
\end{tikzpicture}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published