From ce5e8ba7169c079de023c4ce6e5be2c705ea0132 Mon Sep 17 00:00:00 2001
From: drowe67 <david@rowetel.com>
Date: Sun, 19 Nov 2023 09:21:18 +1030
Subject: macro for sinusoid

---
 doc/codec2.tex | 33 +++++++++++++++++++++++----------
 1 file changed, 23 insertions(+), 10 deletions(-)

(limited to 'doc/codec2.tex')

diff --git a/doc/codec2.tex b/doc/codec2.tex
index c9cd723..07b77ed 100644
--- a/doc/codec2.tex
+++ b/doc/codec2.tex
@@ -2,6 +2,7 @@
 \usepackage{amsmath}
 \usepackage{hyperref}
 \usepackage{tikz}
+\usetikzlibrary{calc}
 \usepackage{float}
 
 \usepackage{xstring}
@@ -75,22 +76,34 @@ A sinewave will cause a spike or spectral line on a spectrum plot, so we can see
 \label{fig:sinusoidal_model}
 \begin{center}
 \begin{tikzpicture}
+
+\newcommand{\DrawSine}[4]{% x, y, x_scale, y_scale
+\begin{tikzpicture}
+%\draw plot [smooth] coordinates {(#1,#2) (0.5,0.707) (1,1) (1.5,0.707) (2,0) (2.5,-0.707) (3,-1) (3.5,-0.707) (4,0)};
+
+\draw plot [smooth] coordinates {(#1-2*#3, #2 )       (#1-1.5*#3,#2+0.707*#4)
+                                 (#1-1*#3, #2+1*#4)   (#1-0.5*#3,#2+0.707*#4)
+                                 (#1  ,#2+0)          (#1+0.5*#3,#2-0.707*#4) 
+                                 (#1+1*#3,#2-1*#4)    (#1+1.5*#3,#2-0.707*#4)
+                                 (#1+2*#3,#2+0)};
+\end{tikzpicture}
+}
+
+%%\draw plot [smooth] coordinates {(0,0) (0.5,0.707) (1,1) (1.5,0.707) (2,0) (2.5,-0.707) (3,-1) (3.5,-0.707) (4,0)};
+
+\DrawSine {0}{1}{0.5}{0.5}
+
+\draw (0,2) circle (0.5);
+\draw (0,0.5) circle (0.5);
+\draw (0,-1.5) circle (0.5);
+
 \draw (1,2) -- (2,2);
 \draw (2.5,0.75) -- (2.5,1.5);
 \draw (2.5,2) circle (0.5);
 \draw (2.25,2) -- (2.75,2);
 \draw (2.5,1.75) -- (2.5,2.25);
 \draw (3,2) -- (4,2);
-\draw (4,1.5) rectangle (5,2.5);
-\draw (5,2) -- (6,2) -- (6,1.5);
-\draw (5.75,1.5) rectangle (6.25,0.5);
-\draw (6,0.5) -- (6,0);
-\draw (5.75,0) -- (6.25,0);
-
-\node[] at (0.5,2) {$P_{sun}$};
-\node[] at (2.5,0.5) {$P_{quiet}$};
-\node[] at (4.5,2) {$G$};
-\node[align=right] at (6.75,1) {Rx};
+
 
 \end{tikzpicture}
 \end{center}
-- 
cgit v1.2.3

