Skip to content

Instantly share code, notes, and snippets.

@aitatanit
Created November 1, 2016 05:48
Show Gist options
  • Save aitatanit/d220c8cea64494c5b0026ef6ea758151 to your computer and use it in GitHub Desktop.
Save aitatanit/d220c8cea64494c5b0026ef6ea758151 to your computer and use it in GitHub Desktop.
Multiple reflections from thin film
% Multiple reflections in thin film
% Author: Jimmy Touma
% adapted from: Jimi Oke (http://www.texample.net/tikz/examples/refraction/)
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{%
decorations.pathreplacing,%
decorations.pathmorphing%
}
\usepackage{verbatim}
\begin{comment}
:Title: Multiple Reflections in Thin Film
:Tags: Arrows;Decorations;Postactions;Markings;Angles;Optics;Physics;Geometry;Mathematics;Reflection;Thin Film
:Author: Jimmy Touma
:Slug: Thin film multiple reflections
: See M. S. Wartak's Computational Photonics An Introduction with MATLAB for the derivation of the
results.
\end{comment}
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{decorations.markings}
\tikzstyle arrowstyle=[scale=1]
\tikzstyle directed=[postaction={decorate,decoration={markings,
mark=at position .65 with {\arrow[arrowstyle]{stealth}}}}]
\tikzstyle reverse directed=[postaction={decorate,decoration={markings,
mark=at position .65 with {\arrowreversed[arrowstyle]{stealth};}}}]
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}[
media/.style={font={\footnotesize\sffamily}},
wave/.style={
decorate,decoration={snake,post length=1.4mm,amplitude=2mm,
segment length=2mm},thick},
interface/.style={
% The border decoration is a path replacing decorator.
% For the interface style we want to draw the original path.
% The postaction option is therefore used to ensure that the
% border decoration is drawn *after* the original path.
postaction={draw,decorate,decoration={border,angle=-45,
amplitude=0.3cm,segment length=2mm}}},
]
% Round rectangle
\fill[gray!10,rounded corners] (-7,0) rectangle (7,-5);
% Interface
\draw[blue,line width=.5pt,interface](-7,0)--(7,0);
% horizontal dashed line
\draw[-,gray](-5,0)--(5,0);
% define coordinates
\coordinate (O) at (0,0) ;
\coordinate (A) at (-3,5) ;
\coordinate (B) at (-3,-5) ;
% Media names
\path[media] (-6,0.5) node {$n_i$}
(-6,-0.5) node {$n_t$};
% axis
\draw[dash pattern=on5pt off3pt] (A) -- (B) ;
% rays
\draw[ultra thick,reverse directed] (-3,0) -- (-5,5)node[above]{$\vec{E}_0$};
\draw[ultra thick, directed] (-3,0) -- (-1,5)node[above]{$\vec{E}_1$};
\draw[directed,ultra thick] (-3,0) -- (-2,-5);
\draw[ultra thick,directed] (-2,-5) -- (-1,0);
\draw[directed,ultra thick] (-1,0) -- (1,5)node[above]{$\vec{E}_2$};
\path (-4,-3)++(0:1.3cm)node{$\phi_t$};
\draw[->] (-2.5,-2.5) arc (-70:-110:0.8cm);
\draw[ultra thick,directed] (-1,0) -- (0,-5);
\draw[directed,ultra thick] (0,-5) -- (1,0);
\draw[directed,ultra thick] (1,0) -- (3,5)node[above]{$\vec{E}_3$};
\draw[directed,ultra thick] (1,0) -- (2,-5);
\draw[directed,ultra thick] (2,-5) -- (3,0);
\draw[directed,ultra thick] (3,0) -- (5,5)node[above]{$\vec{E}_4$};
\draw[directed,ultra thick, dashed] (3,0) -- (4,-5);
\draw[directed,ultra thick, dashed] (4,-5) -- (5,0);
\draw[directed,ultra thick, dashed] (5,0) -- (7,5)node[above]{$\vec{E}_R$};
% thickness
\draw[<->, thick ] (6,0) -- (6,-5);
\draw (6.3,-2.5) node {$d$};
\end{tikzpicture}
\[
E_R=r\,E_0\ e^{i\omega t}\ \frac{1-e^{-i\delta}}{1-r^2e^{-i\delta}}
\]
\[
\delta = 2\,k\,d\,n_t\,\cos\phi_t
\]
$r$ is the reflection coefficient in $n_i$. See M. S. Wartak for reference.
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment