texlive[52047] Master/texmf-dist: simpleoptics (7sep19)

commits+karl at tug.org commits+karl at tug.org
Sat Sep 7 23:21:05 CEST 2019


Revision: 52047
          http://tug.org/svn/texlive?view=revision&revision=52047
Author:   karl
Date:     2019-09-07 23:21:05 +0200 (Sat, 07 Sep 2019)
Log Message:
-----------
simpleoptics (7sep19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.pdf
    trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.tex
    trunk/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty

Modified: trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.tex	2019-09-07 21:20:54 UTC (rev 52046)
+++ trunk/Master/texmf-dist/doc/latex/simpleoptics/simpleoptics.tex	2019-09-07 21:21:05 UTC (rev 52047)
@@ -20,8 +20,8 @@
 \vspace*{\fill}
 \begin{center}
 {\Huge Simple Optics Documentation}\\[0.5cm]
-{\Large Version: 1.0.0}\\[0.4cm]
-{\Large Date: $5^{th}$ of September 2019}\\[0.2cm]
+{\Large Version: 1.1.1}\\[0.4cm]
+{\Large Date: $7^{th}$ of September 2019}\\[0.2cm]
 {\small Author: Justin Cawood}
 \end{center}
 \vspace*{\fill}

Modified: trunk/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty	2019-09-07 21:20:54 UTC (rev 52046)
+++ trunk/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty	2019-09-07 21:21:05 UTC (rev 52047)
@@ -2,9 +2,13 @@
 %%License: LPPL 1.3c
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{simpleoptics}[2019/09/05  v1.0.0 Simple Optics Package]
+\ProvidesPackage{simpleoptics}[2019/09/07  v1.1.1 Simple Optics Package]
 \RequirePackage{tikz}
 
+\newcommand{\straightline}[4]{
+\draw (#1, #2) -- (#3, #4);
+}
+
 %\mirror{x}{y}{focal length}{height}
 \newcommand{\mirror}[4]{
  
@@ -13,15 +17,14 @@
   \pgfmathsetmacro{\mirrorY}{#2}
 
   \pgfmathsetmacro{\mirrorRadius}{2*#3}
-  \pgfmathsetmacro{\mirrorHeight}{\mirrorY + #4}
+  \pgfmathsetmacro{\mirrorHeight}{#4}
   
   \pgfmathsetmacro{\startAngle}{asin(\mirrorHeight/\mirrorRadius)}
   
-  \draw
   
-  (\mirrorX,\mirrorHeight) arc[start angle=180-\startAngle,delta angle=2*\startAngle,radius=\mirrorRadius]
-  
-  ;
+  \begin{scope}[yshift=\mirrorY cm]
+  \draw (\mirrorX,\mirrorHeight) arc[start angle=180-\startAngle,delta angle=2*\startAngle,radius=\mirrorRadius];
+  \end{scope}
 }
 
 %\lens{x}{y}{focal length}{height}{thickness}
@@ -39,13 +42,11 @@
   
   \mirror{\lensXleft}{\lensY}{\lensRadius}{\lensHeight}
   \mirror{\lensXright}{\lensY}{-\lensRadius}{\lensHeight}
-  
-  \draw
-  
-  (\lensXleft,\lensHeight) -- (\lensXright,\lensHeight)
-  (\lensXright,-\lensHeight) -- (\lensXleft,-\lensHeight)
-   
-  ;
+  	
+  \begin{scope}[yshift=\lensY cm]
+  \straightline{\lensXleft}{\lensHeight}{\lensXright}{\lensHeight}
+  \straightline{\lensXright}{-\lensHeight}{\lensXleft}{-\lensHeight}
+  \end{scope}
 }
 
 %\biconvexlens{x}{y}{focal length}{height}{thickness}
@@ -72,12 +73,10 @@
   \mirror{\lensXleft}{\lensY}{\lensRadius}{\lensHeight}
   \mirror{\lensXright}{\lensY}{\lensRadius}{\lensHeight}
   
-  \draw
-  
-  (\lensXleft,\lensHeight) -- (\lensXright,\lensHeight)
-  (\lensXright,-\lensHeight) -- (\lensXleft,-\lensHeight)
-   
-  ;
+  \begin{scope}[yshift=\lensY cm]
+  \straightline{\lensXleft}{\lensHeight}{\lensXright}{\lensHeight}
+  \straightline{\lensXright}{-\lensHeight}{\lensXleft}{-\lensHeight}
+  \end{scope}
 }
 
 %\convexconcavelens{x}{y}{focal length}{height}{thickness}
@@ -98,13 +97,11 @@
   
   \mirror{\lensXleft}{\lensY}{\lensRadius}{\lensHeight}
   
-  \draw
-  
-  (\lensXleft,\lensHeight) -- (\lensXright,\lensHeight)
-  (\lensXright,-\lensHeight) -- (\lensXleft,-\lensHeight)
-  (\lensXright,\lensHeight) -- (\lensXright,-\lensHeight)
-   
-  ;
+  \begin{scope}[yshift=\lensY cm]
+  \straightline{\lensXleft}{\lensHeight}{\lensXright}{\lensHeight}
+  \straightline{\lensXright}{-\lensHeight}{\lensXleft}{-\lensHeight}
+  \straightline{\lensXright}{\lensHeight}{\lensXright}{-\lensHeight}
+  \end{scope}
 }
 
 %\leftplanoconvexlens{x}{y}{focal length}{height}{thickness}
@@ -120,13 +117,11 @@
   
   \mirror{\lensXright}{\lensY}{-\lensRadius}{\lensHeight}
   
-  \draw
-  
-  (\lensXleft,\lensHeight) -- (\lensXright,\lensHeight)
-  (\lensXright,-\lensHeight) -- (\lensXleft,-\lensHeight)
-  (\lensXleft,\lensHeight) -- (\lensXleft,-\lensHeight)
-   
-  ;
+  \begin{scope}[yshift=\lensY cm]
+  \straightline{\lensXleft}{\lensHeight}{\lensXright}{\lensHeight}
+  \straightline{\lensXright}{-\lensHeight}{\lensXleft}{-\lensHeight}
+  \straightline{\lensXleft}{\lensHeight}{\lensXleft}{-\lensHeight}
+  \end{scope}
 }
 
 %\rightplanoconcavelens{x}{y}{focal length}{height}{thickness}



More information about the tex-live-commits mailing list