summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty')
-rw-r--r--Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty61
1 files changed, 28 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty b/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty
index 6d24a6d266f..4620f5ab69c 100644
--- a/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty
+++ b/Master/texmf-dist/tex/latex/simpleoptics/simpleoptics.sty
@@ -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}