Created
September 17, 2024 13:47
-
-
Save QuickWrite/c0a51d02e9af10396085f90dc81bc66b to your computer and use it in GitHub Desktop.
TikZ unit circle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Begin figure (this isn't important for the graphic, but allows it to be easily embedded) | |
\begin{figure} | |
% \centering | |
\begin{tikzpicture}[scale=3] | |
\draw[step=.5cm,black!30!white,very thin] (-1.4,-1.4) grid (1.4,1.4); | |
\filldraw[fill=green!30,draw=green!40!black] (0,0) -- (3mm,0mm) | |
arc [start angle=0, end angle=30, radius=3mm] -- cycle; | |
\node[green!40!black] at (15:2mm) {$\alpha$}; | |
\draw[->] (-1.5,0) -- (1.5,0) coordinate (x axis)node[right]{$x$}; | |
\draw[->] (0,-1.5) -- (0,1.5) coordinate (y axis)node[above]{$y$}; | |
\draw (0,0) circle [radius=1cm]; | |
\draw[very thick,orange] | |
(30:1cm) -- node[left=1pt,fill=white] {$\sin \alpha$} (30:1cm |- x axis); | |
\draw[very thick,blue] | |
(30:1cm |- x axis) -- node[below=2pt,fill=white] {$\cos \alpha$} (0,0); | |
\path [name path=upward line] (1,0) -- (1,1); | |
\path [name path=sloped line] (0,0) -- (30:1.5cm); | |
\draw [name intersections={of=upward line and sloped line, by=t}] | |
[very thick,red] (1,0) -- node [right=1pt,fill=white] | |
{$\displaystyle \tan \alpha$} (t); | |
\draw (0,0) -- (t); | |
\foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1} | |
\draw (\x cm,1pt) -- (\x cm,-1pt) node[anchor=north,fill=white] {$\xtext$}; | |
\foreach \y/\ytext in {-1, -0.5/-\frac{1}{2}, 0.5/\frac{1}{2}, 1} | |
\draw (1pt,\y cm) -- (-1pt,\y cm) node[anchor=east,fill=white] {$\ytext$}; | |
\end{tikzpicture} | |
\caption{Unit circle in TikZ} | |
\label{fig:unit-circle} | |
\end{figure} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment