From 9474394b5d8fefc600c4ab8f472b106f92c59c7b Mon Sep 17 00:00:00 2001 From: Miguel Alejandro Salgado Zapien Date: Tue, 20 Feb 2024 07:35:07 -0800 Subject: [PATCH] Archivos faltantes --- src/d2-01-ejemplo.tex | 23 ++-- src/d2-02-ejemplo.tex | 27 ++++- src/d4-01.tex | 256 ++++++++++++++++++++++++++++++++++++++++++ src/d5-01.tex | 71 ++++++++++++ src/d5-02.tex | 61 ++++++++++ 5 files changed, 423 insertions(+), 15 deletions(-) create mode 100644 src/d4-01.tex create mode 100644 src/d5-01.tex create mode 100644 src/d5-02.tex diff --git a/src/d2-01-ejemplo.tex b/src/d2-01-ejemplo.tex index 3eee917..c671f49 100644 --- a/src/d2-01-ejemplo.tex +++ b/src/d2-01-ejemplo.tex @@ -37,9 +37,10 @@ \coordinate (A) at (90:\R); \coordinate (B) at (90 + 120:\R); \coordinate (C) at (90 + 240:\R); - \node[above] at (A) {$A$}; - \node[below left] at (B) {$B$}; - \node[below right] at (C) {$C$}; + + %\node[above] at (A) {$A$}; + %\node[below left] at (B) {$B$}; + %\node[below right] at (C) {$C$}; \draw @@ -47,16 +48,20 @@ (B) to node[below] {$l$} (C) to node[above right] {$l$} (A); - \draw[fill=black] (A) circle (1.25pt); - \draw[fill=black] (B) circle (1.25pt); - \draw[fill=black] (C) circle (1.25pt); \coordinate (P) at (160:\R); - \draw[gray] (A) to node[above] {$a$} (P); - \draw[gray] (B) to node[left] {$b$} (P); - \draw[gray] (C) to node[above] {$c$} (P); + \draw[gray] (A) to node[above = -0.1mm] {$a$} (P); + \draw[gray] (B) to node[left = +1mm] {$b$} (P); + \draw[gray] (C) to node[above, pos=0.35] {$c$} (P); + + \node at (0, -3) { Por el teorema de Ptolomeo }; + \node at (0, -4) { $c = a + b$ }; + + \draw[fill=black] (A) circle (1.25pt); + \draw[fill=black] (B) circle (1.25pt); + \draw[fill=black] (C) circle (1.25pt); \end{tikzpicture} diff --git a/src/d2-02-ejemplo.tex b/src/d2-02-ejemplo.tex index d399c8f..4db38d8 100644 --- a/src/d2-02-ejemplo.tex +++ b/src/d2-02-ejemplo.tex @@ -13,11 +13,19 @@ \begin{tikzpicture}[scale = 1.2] - % -- cuadrícula de referencia - \draw[help lines] (-3,-3) grid (3,3); - - % -- círculo principal - \draw[gray] (0,0) circle (2); + \coordinate (A) at (-2, -2); + \coordinate (B) at (-0.5, 2.5); + \coordinate (C) at (2, -1); + \coordinate (D) at (0, -0.5); + + % -- ángulos + \pic[draw, semithick, gray, fill=gray!25] {angle = D--A--B}; + \pic[draw, semithick, gray, fill=gray!25] {angle = A--B--C}; + \pic[draw, semithick, gray, fill=gray!25] {angle = B--C--D}; + \pic[draw, semithick, gray, fill=gray!25] {angle = A--D--C}; + + + \draw[thick] (A) to (B) to (C) to (D) to cycle; % -- definición de coordenadas @@ -25,9 +33,16 @@ % -- polígono 2 - % -- ángulos % -- puntos + \draw[semithick, fill=white] (A) circle (1.2pt); + \node[below left] at (A) {$A$}; + \draw[semithick, fill=white] (B) circle (1.2pt); + \node[above] at (B) {$B$}; + \draw[semithick, fill=white] (C) circle (1.2pt); + \node[below right] at (C) {$C$}; + \draw[semithick, fill=white] (D) circle (1.2pt); + \node[above] at (D) {$D$}; % -- etiquetas de los puntos diff --git a/src/d4-01.tex b/src/d4-01.tex new file mode 100644 index 0000000..7f39665 --- /dev/null +++ b/src/d4-01.tex @@ -0,0 +1,256 @@ +% -- Preámbulo +\documentclass{article} + +% idioma y entrada +\usepackage[utf8]{inputenc} +\usepackage[spanish]{babel} +\decimalpoint + +% config de página +\usepackage[ + left = 2cm, right = 2cm, + top = 1.2cm, bottom = 1.2cm, includefoot, +]{geometry} + +% para usar "subfigure" +\usepackage{caption,subcaption} +% para escribir unidades +\usepackage{siunitx} + +% info. del documento +\title{ + \textbf{Día 4} \\ + \Large\textit{Gráfica de funciones 1} +} +\author{Introducción a la creación de gráfico científico con \LaTeX} +\date{13 de noviembre de 2023} + +% colores +\usepackage[dvipsnames]{xcolor} + +% TikZ +\usepackage{tikz} + %para definir variables + \usetikzlibrary{math, babel} + \usetikzlibrary{intersections} + +% -- Cuerpo del documento +\begin{document} + + % Título + \maketitle + + \section{Funciones simples} + + \subsection{Funciones rectangulares $(x,y)$} + + \begin{figure}[h!] + \centering + + % -- a. + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-3.2,-3.2) rectangle (3.6,3.6); + + % plano cartesiano + \draw[<->] + (-3,0) -- (3,0) node[right] {$x$}; + \draw[<->] + (0,-3) -- (0,3) node[above] {$y$}; + + % máscara de recorte + \clip (-3,-3) rectangle (3,3); + + % -- función + \draw[smooth, dashed] plot[domain=-3:3, samples=40] + (\x, { (\x)^2 - 1}); + + \end{tikzpicture} + \caption{$f(x) = x^2 - 1$} + \end{subfigure} + % -- b. + \hspace*{4mm} + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-0.4,-3.2) rectangle (6.6,3.6); + + % plano cartesiano + \draw + (0,0) -- (6,0) node[right] {$x$} + (0,-3) -- (0,3) node[above] {$y$}; + + \clip (0,-3) rectangle (6,3); + + \draw plot[domain= 0:7] (\x, {cos(3 \x r)}); + % -- función + + \end{tikzpicture} + + \caption{$f(x) = \cos(3x)$} + \end{subfigure} + % -- c. + \hspace*{4mm} + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-3.2,-3.2) rectangle (3.6,3.6); + + % plano cartesiano + \draw + (-3,0) -- (3,0) node[right] {$x$} + (0,-3) -- (0,3) node[above] {$y$}; + + \clip (-3,-3) rectangle (3,3); + % -- función + \draw[smooth] plot[domain=-3:3, samples=200] + (\x, {2 * exp( - 0.5 * ((\x)^2)) * sin(6*\x r)}) ; + + + \end{tikzpicture} + + \caption{$2e^{-x^2/2}\sin(6x)$.} + \end{subfigure} + + \caption{} + \end{figure} + + \vspace*{1cm} + + % --- + \subsection{Funciones polares, $(r,\theta)$} + + \begin{figure}[h!] + \centering + + % -- a. + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-2.2,-3.2) rectangle (4.6,3.6); + % plano cartesiano + \draw + (-2,0) -- (4,0) node[right] {$x$} + (0,-3) -- (0,3) node[above] {$y$}; + + \clip (-2,-3) rectangle (4,3); + + % -- función + \draw[smooth] plot[domain=0:2*pi, samples=360] ({\x r}: {2 * cos(\x r) - 1}); + + \end{tikzpicture} + \caption{$f(\theta) = 2\cos(x) - 1$} + \end{subfigure} + % -- b. + \hspace*{4mm} + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-3.2,-3.7) rectangle (3.6,3.1); + % plano cartesiano + \draw + (-3,0) -- (3,0) node[right] {$x$} + (0,-3.5) -- (0,2.5) node[above] {$y$}; + + % -- función + + \draw[smooth] plot[domain=0:2*pi, samples=360] ({\x r}: {2*sin(3 * \x r) + 1}); + + \end{tikzpicture} + + \caption{} + \end{subfigure} + % -- c. + \hspace*{4mm} + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + + % fondo + \fill[gray!10] + (-2.2,-2.2) rectangle (4.6,4.6); + % plano cartesiano + \draw + (-2,0) -- (4,0) node[right] {$x$} + (0,-2) -- (0,4) node[above] {$y$}; + + % -- función + \draw[smooth] plot[domain=0:4*pi, samples=360] ({\x r}: + {6 * sin(2 * \x r) * exp(-0.5 * \x)}); + + \end{tikzpicture} + + \caption{$6\sin(2\theta)e^{-\theta/2}$} + \end{subfigure} + + \caption{} + \end{figure} + + \subsection{Extras} + + \begin{figure}[h!] + \centering + + \hspace*{4mm} + \begin{subfigure}{0.3\textwidth} + \centering + + \begin{tikzpicture}[scale = 0.75] + \tikzmath{ + \limit = 5; + \Px = 0.2; + function f(\x) { return (\x)^2;}; + } + + + \clip (-\limit,0) rectangle (\limit,\limit); + % -- función + \draw[smooth, name path = parabolaA] plot[domain= (-1*\limit):\limit, samples=60] ({\x}, {f(\x)}); + \draw[smooth, name path = lineA ] (-\limit, 1.2) -- (\limit, 2.6); + + \path[name intersections = {of = lineA and parabolaA, by = {A, B} }]; + \coordinate (P) at (\Px, {f(\Px)}); + + \draw[fill=gray!25] (A) -- (B) -- (P) -- cycle; + + + % plano cartesiano + \draw[<->, black!75] + (-\limit,0) -- (\limit,0) node[right] {$x$}; + \draw[<->, black!75] + (0,-0.25 * \limit) -- (0,\limit) node[above] {$y$}; + + \draw[fill=black] (A) circle (2pt); + \draw[fill=black] (B) circle (2pt); + \draw[fill=black] (P) circle (2pt); + + \end{tikzpicture} + + \end{subfigure} + + \caption{} + \end{figure} + +\end{document} diff --git a/src/d5-01.tex b/src/d5-01.tex new file mode 100644 index 0000000..182b463 --- /dev/null +++ b/src/d5-01.tex @@ -0,0 +1,71 @@ +\documentclass[border = 1mm]{standalone} +\usepackage[utf8]{inputenc} + +\usepackage[dvipsnames]{xcolor} + +\usepackage{tikz} +\usetikzlibrary{math, angles, quotes} + +\begin{document} + \begin{tikzpicture}[scale = 0.75] + + \tikzmath { + \R = 4.5; + \conicE = 0.5; + \conicP = 2; + \tI = 120; + \tF = 150; + function conicFunction(\t) { + return \conicP / ( 1 + \conicE * cos (\t)); + }; + } + + \node[right] at (0:\R) {$0$}; + \node[above] at (90:\R) {$\frac{\pi}2$}; + \node[left] at (180:\R) {$\pi$}; + \node[below] at (270:\R) {$\frac{3\pi}2$}; + + \clip (0, 0) circle (\R); + \draw[semithick] (0, 0) circle (\R); + + \foreach \r in {1,2,..., \R} { + \draw[thin, gray!45] (0, 0) circle (\r); + } + \foreach \n in {0,1,...,12} { + \draw[thin, gray!45] (0, 0) -- ({\n*360/12}:{\R}); + \draw[very thin, gray!45] (0, 0) -- ({(\n + 0.5)*360/12}:{\R}); + } + \draw (0, 0) to (0:\R); + + \coordinate (mf) at (\tF: {conicFunction(\tF)}); + \coordinate (mi) at (\tI: {conicFunction(\tI)}); + \coordinate (M) at (0, 0); + \coordinate (V) at (1, 0); + \draw[fill=black] (mf) circle (3pt); + \node[above = 0.5mm] at (mf) {$m$}; + \draw[fill=black] (M) circle (4pt); + \node[below = 0.5mm] at (M) {$M$}; + % \node[red] at (mi) {$\times$}; + + \node[align=center, fill=white, draw] at (0, -3.25) {$\displaystyle r(\theta) = \frac{p}{1 - \varepsilon cos(\theta)}$}; + + \fill[opacity = 0.25] + (M) + -- (mi) + -- plot[domain=120:150, samples=30] ({\x}:{conicFunction(\x)}) + -- (mf) + --cycle; + + \pic[ draw, "$\theta$", angle radius=4mm, angle eccentricity = 1.5] {angle = V--M--mf}; + + \draw[thick, smooth] + plot[domain=0:360, samples=360, variable=\x] ({\x}:{conicFunction(\x)}); + + + + + + + + \end{tikzpicture} +\end{document} diff --git a/src/d5-02.tex b/src/d5-02.tex new file mode 100644 index 0000000..58c151a --- /dev/null +++ b/src/d5-02.tex @@ -0,0 +1,61 @@ +\documentclass[border = 5mm]{standalone} + +\usepackage{inputenc} + +\usepackage{tikz} +\usetikzlibrary{math,angles,quotes} + +\begin{document} +\begin{tikzpicture}[scale = 0.75] + + % def. parámetros y funciones + \tikzmath{ + \R = 4.5; + % + function f(\x) { + return 2/(1 + 0.5*cos(\x r)); + }; + } + + % plano polar + \draw (0,0) circle (\R); + + % eje polar + \draw (0,0) -- (\R,0); + + % etiquetas + \node[right] at (0:\R) {0}; + \node[above] at (90:\R) {$\pi/4$}; + \node[left] at (180:\R) {$\pi/2$}; + \node[below] at (270:\R) {$3\pi/4$}; + + % máscara de recorte + \clip (0,0) circle (\R); + + % definición de ángulo inicial y final +% \tikzmath{ } + + % definición de coordenadas +% \coordinate (p) at ; +% \coordinate (m) at ; +% \coordinate (M) at ; +% +% \coordinate (V) at ; + + % ángulo + + % área + + % elipse +% \draw[thick, smooth] +% plot[domain = 0:2*pi, samples = 60] +% ({\x r}:{f(\x)}); + + % radio vector + + % masas + + % etiqueta + +\end{tikzpicture} +\end{document}