Last active
August 29, 2015 14:16
-
-
Save kpym/97855351bef8c5989ba5 to your computer and use it in GitHub Desktop.
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
\documentclass[tikz]{standalone} | |
\usetikzlibrary{math} | |
\tikzmath{ | |
function sinc(\x) { | |
if abs(\x) < .001 then { % (|x| < .001) ~ (x = 0) | |
return 1; | |
} else { | |
return sin(\x r)/\x; | |
}; | |
}; | |
} | |
\begin{document} | |
\begin{tikzpicture} | |
\draw[help lines] (-3.5,-1.5) grid (3.5,1.5); | |
\begin{scope}[very thick, domain=-pi:pi, samples=100, smooth] | |
\draw[blue] plot (\x,{sin(5*\x r)}); | |
\draw[red] plot (\x,{sinc(5*\x)}); | |
\end{scope} | |
\end{tikzpicture} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment