summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/simpleoptics
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-07 21:21:05 +0000
committerKarl Berry <karl@freefriends.org>2019-09-07 21:21:05 +0000
commit55383837424c9d7e6426f50affe5c0b94ca61392 (patch)
tree491ba2aa5a933bd3571ac6ea22ba6877a7d86f2e /Master/texmf-dist/tex/latex/simpleoptics
parent3ce7332d0be6f5a348073a7ca1f68975e1a039a8 (diff)
simpleoptics (7sep19)
git-svn-id: svn://tug.org/texlive/trunk@52047 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/simpleoptics')
-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}