AndradeGonzalez-wp2017/05/Solutions #05/solution #05.tex

122 lines
2.3 KiB
TeX
Raw Permalink Normal View History

2017-11-27 21:12:40 +01:00
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgf,tikz}
\usepackage{pgfplots}
\usetikzlibrary{arrows,backgrounds}
\pgfplotsset{width=10cm,compat=newest}
\title{\#05 Draw graphs of the following functions}
\author{Enrique Andrade González }
\date{Computer tools in mathematican's work}
\begin{document}
\maketitle
\section{$x^2-2x+3$}
\begin{tikzpicture}
\draw [->] (0,0) -- (0,12);
\draw [<->] (-4,0) -- (6,0);
\draw [help lines] (-4,0) grid (6,12);
% x ^ 2-2x + 3
\draw [blue, domain=-2:4] plot (\x, {pow(\x,2)-\x*2 +3})
node[right] {$v_1(x^2-2x +3)$)};
\node [below] at (0,0) {(0,0)};
\node [above] at (0,12) {(0,12)};
\node [left] at (-4,0) {(-4,0)};
\node [right] at (6,0) {(6,0)};
\end{tikzpicture}
\section{$cos(2x)$}
\begin{tikzpicture}
\draw [<->] (0,-3) -- (0,3);
\draw [<->] (-6,0) -- (6,0);
\draw [help lines] (-6,-3) grid (6,3);
% x ^ 2-2x + 3
\draw [blue, domain=-6:6, samples=100] plot (\x, {cos(\x*2 r)})
node[right] {$v_1(cos(x*2))$};
\node [below] at (0,0) {(0,0)};
\node [above] at (0,3) {(0,3)};
\node [left] at (-6,0) {(-6,0)};
\node [below] at (6,0) {(6,0)};
\node [below] at (0,-3) {(0,-3)};
\end{tikzpicture}
\section{$sin(1/x)$}
\begin{tikzpicture}
\draw [<->] (0,-3) -- (0,3);
\draw [<->] (-6,0) -- (6,0);
\draw [help lines] (-6,-3) grid (6,3);
%% Problema!!! Vale esta solución???
\draw [blue, domain=0.01:6, rotate=180, samples=100] plot (\x, {sin(1/\x r)});
% Problema al tener un 0 en el denominador.
\draw [blue, domain=0.01:6, samples=100] plot (\x, {sin(1/\x r)})
node[right] {$v_1(x^2-2x +3)$)};
\node [below] at (0,0) {(0,0)};
\node [above] at (0,3) {(0,3)};
\node [left] at (-6,0) {(-6,0)};
\node [right] at (6,0) {(6,0)};
\node [below] at (0,-3) {(0,-3)};
\end{tikzpicture}
\section{$x^2+y^2$}
\begin{tikzpicture}
\begin{axis}[
%hide axis,
xlabel=$x$,ylabel=$y$,mesh/interior colormap name=hot,colormap/blackwhite,]
\addplot3[domain=-3:3,surf,samples=41]
{x^2+y^2};
\end{axis}
\end{tikzpicture}
\section{$x^2-y^2+2*x*y^2+1$}
\begin{tikzpicture}
\begin{axis}[
%hide axis,
xlabel=$x$,ylabel=$y$,mesh/interior colormap name=hot,colormap/blackwhite,]
\addplot3[domain=-3:3,surf,samples=41]
{x^2-y^2+2*x*y^2+1};
\end{axis}
\end{tikzpicture}
\end{document}