From 200df2fd74322d3c7b4bb2a69e711a40265ead1b Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 26 Dec 2022 03:03:16 +0000 Subject: CTAN sync 202212260303 --- graphics/pgf/contrib/tikz-mirror-lens/README.md | 42 ++ .../tikz-mirror-lens/doc/tikz-mirror-lens-PT.pdf | Bin 0 -> 1374037 bytes .../tikz-mirror-lens/doc/tikz-mirror-lens-PT.tex | 581 +++++++++++++++++++++ .../tikz-mirror-lens/doc/tikz-mirror-lens.pdf | Bin 0 -> 1361649 bytes .../tikz-mirror-lens/doc/tikz-mirror-lens.tex | 570 ++++++++++++++++++++ .../tikz-mirror-lens/tex/tikz-mirror-lens.cwl | 34 ++ .../tikz-mirror-lens/tex/tikz-mirror-lens.sty | 524 +++++++++++++++++++ 7 files changed, 1751 insertions(+) create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/README.md create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.pdf create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.tex create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.pdf create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.tex create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.cwl create mode 100644 graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.sty (limited to 'graphics') diff --git a/graphics/pgf/contrib/tikz-mirror-lens/README.md b/graphics/pgf/contrib/tikz-mirror-lens/README.md new file mode 100644 index 0000000000..c71332863c --- /dev/null +++ b/graphics/pgf/contrib/tikz-mirror-lens/README.md @@ -0,0 +1,42 @@ +%% The LaTeX package tikz-mirror-lens - version 1.0.0 (2022-12-24) +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2022 by FHZ +%% ------------------------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README +%% + +This is the tikz-mirror-lens package documentation. This package creates draws in TikZ environment +of the light rays reflected in mirror or through lenses. + +Contents of the package +======================= + 'README' this file + 'tikz-mirror-lens.cwl' Completion Word List for some editors + 'tikz-mirror-lens.pdf' Documentation for tikz-mirror-lens + 'tikz-mirror-lens-PT.pdf' Documentation for tikz-mirror-lens in Portuguese + 'tikz-mirror-lens.sty' LaTeX package file (style file) + 'tikz-mirror-lens.tex' Source code of the documentation (main file) + 'tikz-mirror-lens-PT.tex' Source code of the documentation (main file) in Portuguese + +Installation +============ +Copy the contents of the 'tikz-mirror-lens.zip' from CTAN to your local TeX file tree. + +No .ins/.dtx preinstalation is required. + +Version +============ +1.0.0 (2022-12-24): Publication of the package. + diff --git a/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.pdf b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.pdf new file mode 100644 index 0000000000..7a10685d4d Binary files /dev/null and b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.pdf differ diff --git a/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.tex b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.tex new file mode 100644 index 0000000000..9d977fd7be --- /dev/null +++ b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens-PT.tex @@ -0,0 +1,581 @@ +% !TeX spellcheck = pt_BR +% !TeX encoding = UTF-8 +% ============================= + +\documentclass[a4paper,10pt]{article} +\usepackage[brazil]{babel} +\input{input_pacotes} + +% ========== Dados capa folha rosto ========== Sempre crie uma cópia local +\newcommand{\textoVersao}{Versão} +\newcommand{\Titulo}{\textbf{Espelhos e lentes esféricas em {\TikZ} -- Português}} +\newcommand{\Pais}{\textbf{Brasil} -- \textbf{{\today} -- \textoVersao: \versao}} +% ========== + +\begin{document} + +% ========== Capas +{\FHZCapaArticleCabecalho} +% ========== + +\begin{abstract} + \begin{FHZmirroLensTcolorbox} + Esta é a documentação do pacote \texttt{tikz-mirror-lens}. Este pacote permite o desenho automático da imagem de objetos em espelhos e lentes esféricos a partir dos dados do foco, da posição do objeto e de sua altura, calculando a posição e a altura da imagem, e apresentando os raios notáveis. + \end{FHZmirroLensTcolorbox} +\end{abstract} + +\begin{FHZmirroLensTcolorbox} + {\small \tableofcontents} +\end{FHZmirroLensTcolorbox} + +\section{Início rápido, definições e comandos} + +As variáveis utilizadas são: +\begin{itemize} + \item \texttt{f}: foco do espelho ou da lente; + \item \texttt{p}: posição do objeto ao longo do eixo $x$; + \item \texttt{pp}: posição da imagem ao longo do eixo $x$; + \item \texttt{o}: altura do objeto; + \item \texttt{i}: altura da imagem; + \item \texttt{epsilon}: distância absoluta entre $p$ and $f$; + \item \texttt{yM}: altura do espelho; + \item \texttt{xL}: extensão do eixo $x$ à esquerda; + \item \texttt{xR}: extensão do eixo $x$ à direita; + \item \texttt{(xC,yC)}: Coordenadas da localização dos dados apresentados; + \item \texttt{setas}: argumento opcional para alterar a densidade de setas. +\end{itemize} + +Os principais comandos que criam os diagramas do espelho ou da lente a partir do foco $f$, da posição $p$ e da altura $o$ do objeto, além de outros parâmetros de ajustes, são: +\begin{itemize} + \item Espelhos + \begin{itemize} + \item \verb|\mirrorSphGauss[setas]{f}{p}{o}{epsilon}|; + \item \verb|\mirrorSphGaussCoord[setas]{f}{p}{o}{epsilon}|; + \item \verb|\mirrorSphGaussFixed[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}|; + \item \verb|\mirrorSphGaussFixedCoord[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)}|; + \end{itemize} + \item Lentes + \begin{itemize} + \item \verb|\lensSphGauss[setas]{f}{p}{o}{epsilon}|; + \item \verb|\lensSphGaussCoord[setas]{f}{p}{o}{epsilon}|; + \item \verb|\lensSphGaussFixed[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}|; + \item \verb|\lensSphGaussFixedCoord[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)}|; + \end{itemize} + \item Lentes com objeto à esquerda + \begin{itemize} + \item Para cada lente do bloco anterior, troque \enquote{\texttt{Gauss}} por \enquote{\texttt{GaussL}}. + \end{itemize} +\end{itemize} + +\section{Modelo de espelho esférico de Gauss} + +\subsection{Modelagem} + +As equações da posição $p^{\prime}$ e da altura $i$ da imagem a partir do foco $f$ do espelho e da posição $p$ e altura $o$ do objeto são: +\begin{equation} + \begin{split} + \dfrac{1}{f} & = \dfrac{1}{p} + \dfrac{1}{p^{\prime}} \Rightarrow p^{\prime} = \dfrac{f p}{p - f}, \quad p \neq f, \\ + i & = - \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +As definições do tipo de espelho são feitas com base no sinal do foco: +\begin{equation} + \begin{split} + f > 0: & \; \textrm{côncavo}, \\ + f < 0: & \; \textrm{convexo}. + \end{split} +\end{equation} + +A \autoref{fig:def_coordenadas_espelho} apresenta a definição do sistema de coordenadas do espelho, na qual $p > 0$ é a posição do objeto ao longo do eixo $x$ e $p^{\prime} < 0$ é a posição da imagem ao longo do eixo $x$. O vértice $V$ do espelho é a origem do sistemas de coordenadas. + +\begin{figure}[!ht] + \centering + \captionbox{Convenção de sinais para espelhos esféricos\label{fig:def_coordenadas_espelho}}[\linewidth]{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \mirrorBase{2}{2}{-2}{4.5} + \mirrorPts{0}{2}{4} + \mirrorLensObjIma{1}{-2}{1}{2} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1) -- ++(1,0) node[midway, above]{$p > 0$}; + \draw[thin] (1,-1.2) -- ++(0,1); + \draw[-latex] (0,-1) -- ++(-2,0) node[midway, above]{$p^{\prime} < 0$}; + \draw[thin] (-2,-1.2) -- ++(0,1); + \begin{scope}[purple] + \draw (4.5,0) node[above] {$x+$}; + \draw (0,2) node[right] {$y+$}; + \draw (-2.5,0) node[above] {$x-$}; + \draw (0,-2) node[right] {$y-$}; + \end{scope} + \end{tikzpicture} + } +\end{figure} + +\subsection{Configurações prontas de espelhos} + +A \autoref{tab:tab_configuracoes_espelhos} apresenta todas as configurações de espelhos prontas fornecidas pelo pacote. A notação é: +\begin{itemize} + \item \texttt{seta}: distância entre setas desenhadas, em caso de omissão, o padrão é 60 (pt). + \item \texttt{epsilon}: distância entre objeto e o foco na qual a imagem não é calculada nem desenhada por ser muito grande e/ou estar muito longe do vértice; + \item \texttt{yM}: altura do espelho, seja um dado ou um cálculo; + \item \texttt{xL}: limite negativo do eixo $x$; + \item \texttt{xR}: limite positivo do eixo $x$; + \item \texttt{Co}: o par ordenado $(x_C,y_C)$ do bloco de equações que apresentam o foco e as coordenadas do objeto e da imagem. +\end{itemize} + +\begin{table}[!ht] + \centering + \captionbox{Todas as configurações de espelhos prontas\label{tab:tab_configuracoes_espelhos}}[\linewidth]{ + \input{input_tab_configuracoes_espelhos} + } +\end{table} + +\subsection{Comandos constituintes} + +O comando que calcula a posição $p^{\prime}$ e a altura $i$ da imagem é: +\begin{itemize} + \item \verb|\mirrorMath{f}{p}{o}{epsilon}{yM}|. +\end{itemize} + +Os seguintes comandos desenham as principais componentes do diagrama, +\begin{itemize} + \item desenho do espelho: \verb|\mirrorBase{f}{yM}{xL}{xR}|; + \item desenho dos pontos notáveis: \verb|\mirrorPts{v}{f}{c}}|; + \item desenho dos raios notáveis: \verb|\mirrorRays{p}{pp}{o}{i}|. +\end{itemize} + +Os seguintes comandos são os mesmos para os espelhos e para as lentes, e são responsáveis por, +\begin{itemize} + \item desenho do objeto e da imagem: \verb|\mirrorLensObjIma{p}{pp}{o}{i}|; + \item descrição dos valores numéricos das coordenadas: \verb|\mirrorLensCoord{p}{pp}{o}{i}{f}{Co}|. +\end{itemize} + +\subsection{Exemplos de cada caso possível dos espelhos} + +\subsubsection{Côncavo} + +As figuras de \ref{fig:conc01} a \ref{fig:conc05} apresentam os 5 casos possíveis de posicionamento de um objeto diante de um espelho côncavo. + +% \autoref{fig:conc02} ... \autoref{fig:conc03} ... \autoref{fig:conc04} ... \autoref{fig:conc05} ... + + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{4.5}{2.5}{0.4}{3}{1.5}{4}{(4,-1)}|} + \captionbox{Caso 1, objeto longe do espelho, além do centro de + curvatura\label{fig:conc01}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{4.5}{2}{0.4}{3}{1.5}{4}{(4.8,1)} + } + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{4}{2}{0.4}{3}{1.5}{4}{(4.5,1)}|} + \captionbox{Caso 2, objeto localizado sobre o centro de curvatura\label{fig:conc02}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{4}{2}{0.4}{3}{1.5}{4}{(4.5,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{3.6}{2}{0.4}{3}{1.5}{4}{(4,1)}|} + \captionbox{Caso 3, objeto localizado entre o centro de curvatura e o foco do espelho\label{fig:conc03}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{3.6}{2}{0.4}{3}{1.5}{4}{(4,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{2}{2}{0.4}{3}{1.5}{4}{(2.5,1)}|} + \captionbox{Caso 4, objeto localizado sobre o foco do espelho (ou a menos de uma distância $\varepsilon \to 0$)\label{fig:conc04}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{2}{2}{0.4}{3}{1.5}{4}{(2.5,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{0.45}{1.5}{0.4}{2.5}{1}{4}{(2,-1)}|} + \captionbox{Caso 5, objeto localizado entre o foco e o vértice + do espelho\label{fig:conc05}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{0.45}{1.5}{0.4}{2.5}{1}{4}{(2,-1)}} + } +\end{figure} + +\subsubsection{Convexo} + +A \autoref{fig:covx} apresenta duas posições distintas do único caso de posicionamento de um objeto diante de um espelho convexo. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\mirrorSphGaussFixedCoord{-2}{1.5}{1.5}{0.4}{2}{-3}{2}{(2,-1)}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\mirrorSphGaussFixedCoord{-2}{4}{1.5}{0.4}{2}{-3}{4.2}{(2,-1)}|} + \end{minipage} + \captionbox{Caso único, objeto localizado à frente do espelho, a qualquer distância dele\label{fig:covx}}[\linewidth]{ + \subcaptionbox{Objeto próximo do vértice}{ + \adjustbox{width=0.45\linewidth}{\mirrorSphGaussFixedCoord{-2}{1.5}{1.5}{0.4}{2.5}{-3}{2}{(2,-1)}} + }\hfill + \subcaptionbox{Objeto distante do vértice}{ + \adjustbox{width=0.45\linewidth}{\mirrorSphGaussFixedCoord{-2}{4}{1.5}{0.4}{2.5}{-3}{4.2}{(2,-1)}} + } + } +\end{figure} + +% Exercício: Prova que toda a imagem no espelho convexo está entre o vértice $V$ e o foco $f$. Ou seja, é impossível que $p^{\prime}$ seja menor que $f$ e maior que $V$. + +% Exercício: Prova que toda a imagem no espelho convexo é menor que a altura do objeto. + +\subsection{Animação} + +\subsubsection{Côncavo} + +A \autoref{fig:anim_mirror_conc} apresenta uma animação contendo o movimento de um objeto próximo de um espelho côncavo. + +\begin{figure}[ht] + \centering + \captionbox{Animação de objeto se aproximando de um espelho côncavo\label{fig:anim_mirror_conc}}[\linewidth]{ + \adjustbox{height=6cm}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \mirrorSphGaussFixed[50]{2}{6-\rx}{2}{0.4}{11}{-8.5}{12} + } + \end{animateinline} + } + } +\end{figure} + +\subsubsection{Convexo} + +A \autoref{fig:anim_mirror_covx} apresenta uma animação contendo o movimento de um objeto próximo de um espelho convexo. + +\begin{figure}[ht] + \centering + \captionbox{Animação de objeto se aproximando de um espelho convexo\label{fig:anim_mirror_covx}}[\linewidth]{ + \adjustbox{height=6cm}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \mirrorSphGaussFixed[50]{-2}{6-\rx}{2}{0.4}{2.5}{-4.5}{6} + } + \end{animateinline} + } + } +\end{figure} + +\section{Modelo de lente esférica de Gauss} + +\subsection{Modelagem} + +A \autoref{fig:def_coordenadas_lente} apresenta a definição do sistema de coordenadas da lente em dois casos, o com o objeto do lado positivo na \autoref{subfig:def_coordenadas_lente-a} e com o objeto do lado negativo \autoref{subfig:def_coordenadas_lente-b}. + +\begin{figure}[!ht] + \centering + \captionbox{Convenção de sinais para lentes esféricas\label{fig:def_coordenadas_lente}}[\linewidth]{ + \subcaptionbox[0.4\linewidth]{Objeto na referência à direita\label{subfig:def_coordenadas_lente-a}}{ + \adjustbox{width=0.45\linewidth}{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \lensBase{2}{2}{-4.5}{6} + \lensPts{0}{2}{4} + \mirrorLensObjIma{6}{-3}{1.5}{-0.75} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1) -- ++(6,0) node[midway, above]{$p > 0$}; + \draw[thin] (6,-1.2) -- ++(0,1); + \draw[-latex] (0,-1.5) -- ++(-3,0) node[midway, above]{$p^{\prime} < 0$}; + \draw[thin] (-3,-1.5) -- ++(0,0.7); + \begin{scope}[purple] + \draw (6,0) node[below right] {$x+$}; + \draw (0,1.5) node[right] {$y+$}; + \draw (-4,0) node[above left] {$x-$}; + \draw (0,-1.5) node[right] {$y-$}; + \end{scope} + \end{tikzpicture} + } + }\hfill + \subcaptionbox[0.4\linewidth]{Objeto na referência à esquerda\label{subfig:def_coordenadas_lente-b}}{ + \adjustbox{width=0.45\linewidth}{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \lensBase{2}{2}{-6}{4.5} + \lensPts{0}{-2}{-4} + \mirrorLensObjIma{-6}{3}{1.5}{-0.75} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1.4) -- ++(3,0) node[midway, above]{$p^{\prime} > 0$}; + \draw[thin] (3,-1.6) -- ++(0,0.8); + \draw[-latex] (0,-1) -- ++(-6,0) node[midway, above]{$p < 0$}; + \draw[thin] (-6,-1.2) -- ++(0,1); + \begin{scope}[purple] + \draw (4.5,0) node[above] {$x+$}; + \draw (0,1.5) node[right] {$y+$}; + \draw (-6.5,0) node[above] {$x-$}; + \draw (0,-1.5) node[left] {$y-$}; + \end{scope} + \end{tikzpicture} + } + } + } +\end{figure} + +As definições do tipo de lente são feitas com base no sinal do foco: +\begin{equation} + \begin{split} + f > 0: & \quad \textrm{convergente}, \\ + f < 0: & \quad \textrm{divergente}. + \end{split} +\end{equation} + +\subsubsection{Objeto à direita} + +Para o objeto à direita, a forma mais fácil de corrigir o modelo de um espelho esférico para uma lente esférica é com troca do sinal de $p^{\prime}$. + +As equações da posição $p^{\prime}$ e da altura $i$ da imagem a partir do foco $f$ do espelho, e da posição $p$ e altura $o$ do objeto são: +\begin{equation} + \begin{split} + \dfrac{1}{f} & = \dfrac{1}{p} - \dfrac{1}{p^{\prime}} \Rightarrow p^{\prime} = \dfrac{f p}{f - p}, \quad p \neq f, \\ + i & = \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +\subsubsection{Objeto à esquerda} + +Para o objeto à esquerda, a expressão de $p^{\prime}$ e $i$ são dadas por: +\begin{equation} + \begin{split} + \dfrac{1}{p^{\prime}} & = \dfrac{1}{p} + \dfrac{1}{f} \Rightarrow p^{\prime} = \dfrac{f p}{f + p}, \quad p \neq -f, \\ + i & = \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +\subsection{Configurações prontas de lentes} + +A \autoref{tab:tab_configuracoes_lentes} apresenta todas as configurações de lentes prontas fornecidas pelo pacote. + +\begin{table}[ht] + \centering + \captionbox{Todas as configurações de lentes prontas\label{tab:tab_configuracoes_lentes}}[\linewidth]{ + \input{input_tab_configuracoes_lentes} + } +\end{table} + +\subsection{Configurações prontas de lentes -- à esquerda} + +A \autoref{tab:tab_configuracoes_lentesL} apresenta todas as configurações de lentes prontas fornecidas pelo pacote. + +\begin{table}[ht] + \centering + \captionbox{Todas as configurações de lentes prontas com objeto à esquerda\label{tab:tab_configuracoes_lentesL}}[\linewidth]{ + \input{input_tab_configuracoes_lentesL} + } +\end{table} + +\subsection{Comandos constituintes} + +% TODO: Convenção gaussiana? +O comando que calcula a posição $p^{\prime}$ e a altura $i$ da imagem com objeto à direita é: +\begin{itemize} + \item \verb|\lensMath{f}{p}{o}{epsilon}{yM}|. +\end{itemize} + +% TODO: Convenção cartesiana? +Por sua vez, o comando que calcula as coordenadas da imagem com o objeto à esquerda é: +\begin{itemize} + \item \verb|\lensMathL{f}{p}{o}{epsilon}{yM}|, +\end{itemize} +por sua vez, a alteração na nomenclatura dos comandos que desenha as lentes é apenas a adição da letra $L$ após a palavra \enquote{Gauss}. + +Os seguintes comandos desenham as principais componentes do diagrama, +\begin{itemize} + \item desenho da lente: \verb|\lensBase{f}{yM}{xL}{xR}|; + \item desenho dos pontos notáveis: \verb|\lensPts{v}{f}{a}|; + \item desenho dos raios notáveis: \verb|\lensRays{p}{pp}{o}{i}|. +\end{itemize} + +\subsection{Exemplos de cada caso possível das lentes} + +\subsubsection{Convergente} + +As figuras de \ref{fig:conv01} a \ref{fig:conv05} apresentam os 5 casos possíveis de posicionamento de um objeto diante de uma lente convergente. + +% \autoref{fig:conv02} ... \autoref{fig:conv03} ... \autoref{fig:conv04} ... \autoref{fig:conv05} ... + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{5}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}|} + \captionbox{Caso 1, objeto longe do espelho, além do centro de curvatura\label{fig:conv01}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{5}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{4}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}|} + \captionbox{Caso 2, objeto sobre o antiprincipal objeto\label{fig:conv02}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{4}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{3.5}{1.5}{0.4}{2.5}{-4}{4}{(2,-1.5)}|} + \captionbox{Caso 3, objeto entre o antiprincipal objeto e o foco objeto\label{fig:conv03}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{3.5}{1.5}{0.4}{2.5}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{2}{1.5}{0.4}{2}{-5}{5}{(2,-1)}|} + \captionbox{Caso 4, objeto sobre o foco objeto (ou a menos de uma distância $\varepsilon \to 0$)\label{fig:conv04}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{2}{1.5}{0.4}{2}{-5}{5}{(2,-1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{1.2}{1}{0.4}{3}{-4}{4}{(1.5,-1.5)}|} + \captionbox{Caso 5, objeto entre o foco objeto e o centro óptico da lente\label{fig:conv05}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{1.2}{1}{0.4}{3}{-4}{4}{(1.5,-1.5)}} + } +\end{figure} + +\subsubsection{Divergente} + +A \autoref{fig:dive} apresenta duas posições distintas do único caso de posicionamento de um objeto diante de uma lente divergente. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixed[50]{-2}{2}{2}{0.4}{2.5}{-4}{4}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixed[50]{-2}{4}{2}{0.4}{2.5}{-4}{4}|} + \end{minipage} + \captionbox{Caso único, objeto localizado à frente da lente, a qualquer distância dele\label{fig:dive}}[\linewidth]{ + \subcaptionbox{Entre foco e vértice}{ + \adjustbox{height=3cm}{\lensSphGaussFixed[50]{-2}{2}{1.5}{0.4}{2.5}{-3}{3}} + }\quad\quad\quad + \subcaptionbox{Além do centro de curvatura}{ + \adjustbox{height=3cm}{\lensSphGaussFixed[50]{-2}{4}{1.5}{0.4}{2.5}{-3}{3}} + } + } +\end{figure} + +\subsection{Equivalência entre comandos para lentes com objeto à direita e à esquerda} + +A \autoref{fig:equiv_conv} apresenta a equivalência entre os comandos que calculam e desenho a imagem por meio do uso lentes convergentes em função da localização do objeto. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixedCoord{2}{6}{1.5}{0.4}{2}{-4.2}{4.2}{(2,-1.5)}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussLFixedCoord{2}{-6}{1.5}{0.4}{2}{-4.2}{4.2}{(-4,-1.5)}|} + \end{minipage} + \captionbox{Equivalência entre comandos para lentes convergentes\label{fig:equiv_conv}}[\linewidth]{ + \subcaptionbox{Comando para objeto à direita}{ + \adjustbox{height=2.8cm}{\lensSphGaussFixedCoord{2}{6}{1.2}{0.4}{2}{-3}{4.2}{(2,-1.5)}} + }\hfill + \subcaptionbox{Comando para objeto à esquerda}{ + \adjustbox{height=2.8cm}{\lensSphGaussLFixedCoord{2}{-6}{1.2}{0.4}{2}{-4.2}{3}{(-5,-1.5)}} + } + } +\end{figure} + +A \autoref{fig:equiv_dive} apresenta a equivalência entre os comandos que calculam e desenho a imagem por meio do uso lentes divergentes em função da localização do objeto. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixedCoord{2}{6}{1.5}{0.4}{2}{-4.2}{4.2}{(2,-1.5)}|} + \end{minipage}% + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussLFixedCoord{2}{-6}{1.5}{0.4}{2}{-4.2}{4.2}{(-4,-1.5)}|} + \end{minipage} + \captionbox{Equivalência entre comandos para lentes divergentes\label{fig:equiv_dive}}[\linewidth]{ + \subcaptionbox{Comando para objeto à direita}{ + \adjustbox{height=2.8cm}{\lensSphGaussFixedCoord{-2}{4}{1.2}{0.4}{2}{-2.5}{2.5}{(1,-1.5)}} + }\hfill + \subcaptionbox{Comando para objeto à esquerda}{ + \adjustbox{height=2.8cm}{\lensSphGaussLFixedCoord{-2}{-4}{1.2}{0.4}{2}{-2.5}{2.5}{(-5,-1.5)}} + } + } +\end{figure} + +\subsection{Animação} + +\subsubsection{Convergente} + +A \autoref{fig:anim_len_conv} apresenta uma animação contendo o movimento de um objeto próximo de uma lente convergente. + +\begin{figure}[!ht] + \centering + \captionbox{Animação de objeto se aproximando de uma lente convergente\label{fig:anim_len_conv}}[\linewidth]{ + \adjustbox{width=0.6\linewidth}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \lensSphGaussFixed[50]{2}{6-\rx}{2}{0.4}{11}{-12.5}{8.5} + } + \end{animateinline} + } + } +\end{figure} + +\subsubsection{Divergente} + +A \autoref{fig:anim_len_dive} apresenta uma animação contendo o movimento de um objeto próximo de uma lente divergente. + +\begin{figure}[!ht] + \centering + \captionbox{Animação de objeto se aproximando de uma lente divergente\label{fig:anim_len_dive}}[\linewidth]{ + \adjustbox{width=0.6\linewidth}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \lensSphGaussFixed[50]{-2}{6-\rx}{2}{0.4}{2.5}{-4.5}{6} + } + \end{animateinline} + } + } +\end{figure} + +\section{Outros pacotes interessantes} + +A seguir, encontram-se \textit{links} interessantes para outros pacotes com implementações de ótica, e também fontes para as equações e modelagens utilizadas. + +\begin{FHZmirroLensTcolorbox} + \begin{enumerate} + \item \href{https://tex.stackexchange.com/q/33460/140133}{\textbf{TeX StackExchange} -- TikZ library for optics?} + \item \href{https://tex.stackexchange.com/q/623201/140133}{\textbf{TeX StackExchange} -- Geometrical optics} + \item \href{https://ctan.org/pkg/tikz-optics}{{\textbf{CTAN}} -- tikz-optics} + \item \href{https://ctan.org/pkg/pst-mirror}{\textbf{CTAN} -- pst-mirror} + \item \href{https://ctan.org/pkg/simpleoptics}{\textbf{CTAN} -- simpleoptics} + + \item \href{https://youtu.be/efPZ5uSDeuI}{{\YouTube} -- The Organic Chemistry Tutor -- Spherical Mirrors \& The Mirror Equation - Geometric Optics} + \item \href{http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/mireq.html}{hyperphysics -- Spherical Mirror Equation} + + + \item \href{http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/lenseq.html}{hyperphysics -- lenseq} + \item \href{https://www.plymouth.ac.uk/uploads/production/document/path/3/3754/PlymouthUniversity_MathsandStats_outreach_lenses.pdf}{plymouth -- lenses} + \item \href{https://www.khanacademy.org/science/in-in-class10th-physics/in-in-10th-physics-light-reflection-refraction/in-in-lens-formula-magnification/v/lens-formula}{khanacademy -- lens formula} + % https://brasilescola.uol.com.br/fisica/espelhos-esfericos.htm + % https://mundoeducacao.uol.com.br/fisica/lentes-esfericas.htm + % https://www.todamateria.com.br/lentes-esfericas/ + % https://pt.wikipedia.org/wiki/Lente + \end{enumerate} +\end{FHZmirroLensTcolorbox} + +\section{Histórico e versões} + +\begin{FHZmirroLensTcolorbox} + \begin{enumerate}[leftmargin=3.5cm] + \item[1.0.0 (2022-12-24):] Criação do pacote. + \end{enumerate} +\end{FHZmirroLensTcolorbox} + +\end{document} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.pdf b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.pdf new file mode 100644 index 0000000000..bf794f1b8f Binary files /dev/null and b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.pdf differ diff --git a/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.tex b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.tex new file mode 100644 index 0000000000..13e39dc610 --- /dev/null +++ b/graphics/pgf/contrib/tikz-mirror-lens/doc/tikz-mirror-lens.tex @@ -0,0 +1,570 @@ +% !TeX spellcheck = en_US +% !TeX encoding = UTF-8 +% ============================= + +\documentclass[a4paper,10pt]{article} +\input{input_pacotes} + +% ========== Dados capa folha rosto ========== Sempre crie uma cópia local +\newcommand{\textoVersao}{Version} +\newcommand{\Titulo}{\textbf{Spherical mirrors and lenses in {\TikZ} -- English}} +\newcommand{\Pais}{\textbf{Brazil} -- \textbf{{\today} -- \textoVersao: \versao}} +% ========== + +\begin{document} + +% ========== Capas +{\FHZCapaArticleCabecalho} +% ========== + +\begin{abstract} + \begin{FHZmirroLensTcolorbox} + This is the documentation for the \texttt{tikz-mirror-lens} package. This package allows the automatic drawing of the image of objects in spherical mirrors and lenses from the data of the focus, from the position and height of the object, calculating the position and height of the image, and presenting the notable rays. + \end{FHZmirroLensTcolorbox} +\end{abstract} + +\begin{FHZmirroLensTcolorbox} + {\small \tableofcontents} +\end{FHZmirroLensTcolorbox} + +\section{Quick start, settings and commands} + +The variables used are: +\begin{itemize} + \item \texttt{f}: mirror or lens focus; + \item \texttt{p}: position of the object along the $x$ axis; + \item \texttt{pp}: position of the image along the $x$ axis; + \item \texttt{o}: height of the object; + \item \texttt{i}: image height; + \item \texttt{epsilon}: absolute distance between $p$ and $f$; + \item \texttt{yM}: mirror height; + \item \texttt{xL}: axis extension $x$ to the left; + \item \texttt{xR}: axis extension $x$ to the right; + \item \texttt{(xC,yC)}: Coordinates of the location of the presented data; + \item \texttt{arrows}: optional argument to change the density of arrows. +\end{itemize} + +The main commands that create the mirror or lens diagrams based on the object's focus $f$, position $p$ and height $o$, in addition to other adjustment parameters, are: +\begin{itemize} + \item Mirrors + \begin{itemize} + \item \verb|\mirrorSphGauss[setas]{f}{p}{o}{epsilon}|; + \item \verb|\mirrorSphGaussCoord[setas]{f}{p}{o}{epsilon}|; + \item \verb|\mirrorSphGaussFixed[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}|; + \item \verb|\mirrorSphGaussFixedCoord[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)}|; + \end{itemize} + \item Lenses + \begin{itemize} + \item \verb|\lensSphGauss[setas]{f}{p}{o}{epsilon}|; + \item \verb|\lensSphGaussCoord[setas]{f}{p}{o}{epsilon}|; + \item \verb|\lensSphGaussFixed[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}|; + \item \verb|\lensSphGaussFixedCoord[setas]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)}|; + \end{itemize} + \item Lenses with object on the left + \begin{itemize} + \item For each lens in the previous block, change \enquote{\texttt{Gauss}} to \enquote{\texttt{GaussL}}. + \end{itemize} +\end{itemize} + +\section{Gaussian spherical mirror model} + +\subsection{Modeling} + +The equations for the position $p^{\prime}$ and the height $i$ of the image from the focus $f$ of the mirror and the position $p$ and height $o$ of the object are: +\begin{equation} + \begin{split} + \dfrac{1}{f} & = \dfrac{1}{p} + \dfrac{1}{p^{\prime}} \Rightarrow p^{\prime} = \dfrac{f p}{p - f}, \quad p \neq f, \\ + i & = - \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +Mirror type definitions are made based on the focus' signal: +\begin{equation} + \begin{split} + f > 0: & \; \textrm{concave}, \\ + f < 0: & \; \textrm{convex}. + \end{split} +\end{equation} + +\autoref{fig:def_coordenadas_espelho} presents the definition of the mirror coordinate system, in which $p > 0$ is the position of the object along the $x$ axis and $p^{\prime} < 0$ is the image position along the $x$ axis. The vertex $V$ of the mirror is the origin of the coordinate system. + +\begin{figure}[!ht] + \centering + \captionbox{Sign convention for spherical mirrors\label{fig:def_coordenadas_espelho}}[\linewidth]{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \mirrorBase{2}{2}{-2}{4.5} + \mirrorPts{0}{2}{4} + \mirrorLensObjIma{1}{-2}{1}{2} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1) -- ++(1,0) node[midway, above]{$p > 0$}; + \draw[thin] (1,-1.2) -- ++(0,1); + \draw[-latex] (0,-1) -- ++(-2,0) node[midway, above]{$p^{\prime} < 0$}; + \draw[thin] (-2,-1.2) -- ++(0,1); + \begin{scope}[purple] + \draw (4.5,0) node[above] {$x+$}; + \draw (0,2) node[right] {$y+$}; + \draw (-2.5,0) node[above] {$x-$}; + \draw (0,-2) node[right] {$y-$}; + \end{scope} + \end{tikzpicture} + } +\end{figure} + +\subsection{Ready-made mirror setups} + +\autoref{tab:tab_configuracoes_espelhos} presents all ready-made mirror configurations provided by the package. The notation is: +\begin{itemize} + \item \texttt{arrow}: distance between drawn arrows, in case of omission, the default is 60 (pt). + \item \texttt{epsilon}: distance between object and focus at which the image is not calculated or drawn because it is too big and/or too far from the vertex; + \item \texttt{yM}: mirror height, either data or calculation; + \item \texttt{xL}: negative limit of the $x$ axis; + \item \texttt{xR}: positive limit of the $x$ axis; + \item \texttt{Co}: the ordered pair $(x_C,y_C)$ of the block of equations that show the focus and coordinates of the object and the image. +\end{itemize} + +\begin{table}[!ht] + \centering + \captionbox{All mirror settings ready\label{tab:tab_configuracoes_espelhos}}[\linewidth]{ + \input{input_tab_configuracoes_espelhos} + } +\end{table} + +\subsection{Constituent commands} + +The command that calculates the position $p^{\prime}$ and the height $i$ of the image is: +\begin{itemize} + \item \verb|\mirrorMath{f}{p}{o}{epsilon}{yM}|. +\end{itemize} + +The following commands draw the main components of the diagram, +\begin{itemize} + \item mirror drawing: \verb|\mirrorBase{f}{yM}{xL}{xR}|; + \item notable points drawing: \verb|\mirrorPts{v}{f}{c}}|; + \item notable rays drawing: \verb|\mirrorRays{p}{pp}{o}{i}|. +\end{itemize} + +The following commands are the same for mirrors and lenses, and are responsible for, +\begin{itemize} + \item object and image drawing item: \verb|\mirrorLensObjIma{p}{pp}{o}{i}|; + \item description of numerical coordinate values: \verb|\mirrorLensCoord{p}{pp}{o}{i}{f}{Co}|. +\end{itemize} + +\subsection{Examples of each possible mirror case} + +\subsubsection{Concave} + +Figures from \ref{fig:conc01} to \ref{fig:conc05} present the 5 possible cases of positioning an object in front of a concave mirror. + +% \autoref{fig:conc02} ... \autoref{fig:conc03} ... \autoref{fig:conc04} ... \autoref{fig:conc05} ... + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{4.5}{2.5}{0.4}{3}{1.5}{4}{(4,-1)}|} + \captionbox{Case 1, object far from the mirror, beyond the center of curvature\label{fig:conc01}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{4.5}{2}{0.4}{3}{1.5}{4}{(4.8,1)} + } + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{4}{2}{0.4}{3}{1.5}{4}{(4.5,1)}|} + \captionbox{Case 2, object located on the center of curvature\label{fig:conc02}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{4}{2}{0.4}{3}{1.5}{4}{(4.5,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{3.6}{2}{0.4}{3}{1.5}{4}{(4,1)}|} + \captionbox{Case 3, object located between the center of curvature and the focus of the mirror\label{fig:conc03}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{3.6}{2}{0.4}{3}{1.5}{4}{(4,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{2}{2}{0.4}{3}{1.5}{4}{(2.5,1)}|} + \captionbox{Case 4, object located on the focus of the mirror (or less than a distance $\varepsilon \to 0$)\label{fig:conc04}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{2}{2}{0.4}{3}{1.5}{4}{(2.5,1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\mirrorSphGaussFixedCoord{2}{0.45}{1.5}{0.4}{2.5}{1}{4}{(2,-1)}|} + \captionbox{Case 5, object located between focus and mirror vertex\label{fig:conc05}}[\linewidth]{ + \adjustbox{height=4cm}{\mirrorSphGaussFixedCoord{2}{0.45}{1.5}{0.4}{2.5}{1}{4}{(2,-1)}} + } +\end{figure} + +\subsubsection{Convex} + +\autoref{fig:covx} presents two different positions of the single case of positioning an object in front of a convex mirror. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\mirrorSphGaussFixedCoord{-2}{1.5}{1.5}{0.4}{2}{-3}{2}{(2,-1)}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\mirrorSphGaussFixedCoord{-2}{4}{1.5}{0.4}{2}{-3}{4.2}{(2,-1)}|} + \end{minipage} + \captionbox{Single case, object located in front of the mirror, at any distance from it\label{fig:covx}}[\linewidth]{ + \subcaptionbox{Object close to vertex}{ + \adjustbox{width=0.45\linewidth}{\mirrorSphGaussFixedCoord{-2}{1.5}{1.5}{0.4}{2.5}{-3}{2}{(2,-1)}} + }\hfill + \subcaptionbox{Object far from vertex}{ + \adjustbox{width=0.45\linewidth}{\mirrorSphGaussFixedCoord{-2}{4}{1.5}{0.4}{2.5}{-3}{4.2}{(2,-1)}} + } + } +\end{figure} + +% Exercício: Prova que toda a imagem no espelho convexo está entre o vértice $V$ e o foco $f$. Ou seja, é impossível que $p^{\prime}$ seja menor que $f$ e maior que $V$. + +% Exercício: Prova que toda a imagem no espelho convexo é menor que a altura do objeto. + +\subsection{Animation} + +\subsubsection{Concave} + +\autoref{fig:anim_mirror_conc} presents an animation containing the movement of an object close to a concave mirror. + +\begin{figure}[ht] + \centering + \captionbox{Animation of object approaching a concave mirror\label{fig:anim_mirror_conc}}[\linewidth]{ + \adjustbox{height=6cm}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \mirrorSphGaussFixed[50]{2}{6-\rx}{2}{0.4}{11}{-8.5}{12} + } + \end{animateinline} + } + } +\end{figure} + +\subsubsection{Convex} + +\autoref{fig:anim_mirror_covx} presents an animation containing the movement of an object close to a convex mirror. + +\begin{figure}[ht] + \centering + \captionbox{Animation of object approaching a convex mirror\label{fig:anim_mirror_covx}}[\linewidth]{ + \adjustbox{height=6cm}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \mirrorSphGaussFixed[50]{-2}{6-\rx}{2}{0.4}{2.5}{-4.5}{6} + } + \end{animateinline} + } + } +\end{figure} + +\section{Gaussian spherical lens model} + +\subsection{Modeling} + +\autoref{fig:def_coordenadas_lente} presents the definition of the lens coordinate system in two cases, the one with the object on the positive side in \autoref{subfig:def_coordenadas_lente-a} and with the object on the negative side \autoref{subfig:def_coordenadas_lente-b}. + +\begin{figure}[!ht] + \centering + \captionbox{Sign convention for spherical lenses\label{fig:def_coordenadas_lente}}[\linewidth]{ + \subcaptionbox[0.4\linewidth]{Object in right reference\label{subfig:def_coordenadas_lente-a}}{ + \adjustbox{width=0.45\linewidth}{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \lensBase{2}{2}{-4.5}{6} + \lensPts{0}{2}{4} + \mirrorLensObjIma{6}{-3}{1.5}{-0.75} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1) -- ++(6,0) node[midway, above]{$p > 0$}; + \draw[thin] (6,-1.2) -- ++(0,1); + \draw[-latex] (0,-1.5) -- ++(-3,0) node[midway, above]{$p^{\prime} < 0$}; + \draw[thin] (-3,-1.5) -- ++(0,0.7); + \begin{scope}[purple] + \draw (6,0) node[below right] {$x+$}; + \draw (0,1.5) node[right] {$y+$}; + \draw (-4,0) node[above left] {$x-$}; + \draw (0,-1.5) node[right] {$y-$}; + \end{scope} + \end{tikzpicture} + } + }\hfill + \subcaptionbox[0.4\linewidth]{Object in left reference\label{subfig:def_coordenadas_lente-b}}{ + \adjustbox{width=0.45\linewidth}{ + \begin{tikzpicture}[ + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm] + \lensBase{2}{2}{-6}{4.5} + \lensPts{0}{-2}{-4} + \mirrorLensObjIma{-6}{3}{1.5}{-0.75} + \draw[red] (0,0) node[above left] {(0,0)}; + \draw[-latex] (0,-1.4) -- ++(3,0) node[midway, above]{$p^{\prime} > 0$}; + \draw[thin] (3,-1.6) -- ++(0,0.8); + \draw[-latex] (0,-1) -- ++(-6,0) node[midway, above]{$p < 0$}; + \draw[thin] (-6,-1.2) -- ++(0,1); + \begin{scope}[purple] + \draw (4.5,0) node[above] {$x+$}; + \draw (0,1.5) node[right] {$y+$}; + \draw (-6.5,0) node[above] {$x-$}; + \draw (0,-1.5) node[left] {$y-$}; + \end{scope} + \end{tikzpicture} + } + } + } +\end{figure} + +Lens type definitions are made based on the focus signal: +\begin{equation} + \begin{split} + f > 0: & \quad \textrm{convergent}, \\ + f < 0: & \quad \textrm{divergent}. + \end{split} +\end{equation} + +\subsubsection{Object on the right} + +For the object on the right, the easiest way to correct the model from a spherical mirror to a spherical lens is to change the sign of $p^{\prime}$. + +The equations for the position $p^{\prime}$ and the height $i$ of the image from the focus $f$ of the mirror, and the position $p$ and height $o$ of the object are: +\begin{equation} + \begin{split} + \dfrac{1}{f} & = \dfrac{1}{p} - \dfrac{1}{p^{\prime}} \Rightarrow p^{\prime} = \dfrac{f p}{f - p}, \quad p \neq f, \\ + i & = \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +\subsubsection{Objeto à esquerda} + +Para o objeto à esquerda, a expressão de $p^{\prime}$ e $i$ são dadas por: +\begin{equation} + \begin{split} + \dfrac{1}{p^{\prime}} & = \dfrac{1}{p} + \dfrac{1}{f} \Rightarrow p^{\prime} = \dfrac{f p}{f + p}, \quad p \neq -f, \\ + i & = \dfrac{p^{\prime}}{p} o. + \end{split} +\end{equation} + +\subsection{Ready lens settings} + +The \autoref{tab:tab_configuracoes_lentes} presents all the ready-made lens configurations provided by the package. + +\begin{table}[ht] + \centering + \captionbox{All lens settings ready\label{tab:tab_configuracoes_lentes}}[\linewidth]{ + \input{input_tab_configuracoes_lentes} + } +\end{table} + +\subsection{Ready lens settings -- left} + +The \autoref{tab:tab_configuracoes_lentesL} presents all the ready-made lens settings provided by the package. + +\begin{table}[ht] + \centering + \captionbox{All lens settings ready with object on left\label{tab:tab_configuracoes_lentesL}}[\linewidth]{ + \input{input_tab_configuracoes_lentesL} + } +\end{table} + +\subsection{Constituent commands} + +The command that calculates the position $p^{\prime}$ and height $i$ of the image with object on the right is: +\begin{itemize} + \item \verb|\lensMath{f}{p}{o}{epsilon}{yM}|. +\end{itemize} + +In turn, the command that calculates the coordinates of the image with the object on the left is: +\begin{itemize} + \item \verb|\lensMathL{f}{p}{o}{epsilon}{yM}|, +\end{itemize} +nonetheless, the change in the nomenclature of the commands that draw the lenses is just the addition of the letter $L$ after the word \enquote{Gauss}. + +The following commands draw the main components of the diagram, +\begin{itemize} + \item lens design: \verb|\lensBase{f}{yM}{xL}{xR}|; + \item notable points drawing: \verb|\lensPts{v}{f}{a}|; + \item notable ray drawing: \verb|\lensRays{p}{pp}{o}{i}|. +\end{itemize} + +\subsection{Examples of each possible lens case} + +\subsubsection{Convergent} + +Figures from \ref{fig:conv01} to \ref{fig:conv05} present the 5 possible cases of positioning an object in front of a converging lens. + +% \autoref{fig:conv02} ... \autoref{fig:conv03} ... \autoref{fig:conv04} ... \autoref{fig:conv05} ... + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{5}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}|} + \captionbox{Case 1, object far from mirror, beyond center of curvature\label{fig:conv01}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{5}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{4}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}|} + \captionbox{Case 2, object over anti-main object\label{fig:conv02}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{4}{1.5}{0.4}{2}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{3.5}{1.5}{0.4}{2.5}{-4}{4}{(2,-1.5)}|} + \captionbox{Case 3, object between anti-main object and focus object\label{fig:conv03}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{3.5}{1.5}{0.4}{2.5}{-4}{4}{(2,-1.5)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{2}{1.5}{0.4}{2}{-5}{5}{(2,-1)}|} + \captionbox{Case 4, object over object focus (or less than a distance $\varepsilon \to 0$)\label{fig:conv04}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{2}{1.5}{0.4}{2}{-5}{5}{(2,-1)}} + } +\end{figure} + +\begin{figure}[!ht] + \centering + {\scriptsize \verb|\lensSphGaussFixedCoord{2}{1.2}{1}{0.4}{3}{-4}{4}{(1.5,-1.5)}|} + \captionbox{Case 5, object between focus object and optical center of lens\label{fig:conv05}}[\linewidth]{ + \adjustbox{height=3cm}{\lensSphGaussFixedCoord{2}{1.2}{1}{0.4}{3}{-4}{4}{(1.5,-1.5)}} + } +\end{figure} + +\subsubsection{Divergent} + +\autoref{fig:dive} presents two different positions of the single case of positioning an object in front of a diverging lens. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixed[50]{-2}{2}{2}{0.4}{2.5}{-4}{4}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixed[50]{-2}{4}{2}{0.4}{2.5}{-4}{4}|} + \end{minipage} + \captionbox{Single case, object located in front of the lens, at any distance from it\label{fig:dive}}[\linewidth]{ + \subcaptionbox{Between focus and vertex}{ + \adjustbox{height=3cm}{\lensSphGaussFixed[50]{-2}{2}{1.5}{0.4}{2.5}{-3}{3}} + }\quad\quad\quad + \subcaptionbox{Beyond the center of curvature}{ + \adjustbox{height=3cm}{\lensSphGaussFixed[50]{-2}{4}{1.5}{0.4}{2.5}{-3}{3}} + } + } +\end{figure} + +\subsection{Equivalence between commands for lenses with objects on the right and on the left} + +\autoref{fig:equiv_conv} presents the equivalence between the commands that calculate and draw the image using converging lenses depending on the location of the object. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixedCoord{2}{6}{1.5}{0.4}{2}{-4.2}{4.2}{(2,-1.5)}|} + \end{minipage} % + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussLFixedCoord{2}{-6}{1.5}{0.4}{2}{-4.2}{4.2}{(-4,-1.5)}|} + \end{minipage} + \captionbox{Equivalence between commands for converging lenses\label{fig:equiv_conv}}[\linewidth]{ + \subcaptionbox{Command for object on the right}{ + \adjustbox{height=2.8cm}{\lensSphGaussFixedCoord{2}{6}{1.2}{0.4}{2}{-3}{4.2}{(2,-1.5)}} + }\hfill + \subcaptionbox{Command for object on the left}{ + \adjustbox{height=2.8cm}{\lensSphGaussLFixedCoord{2}{-6}{1.2}{0.4}{2}{-4.2}{3}{(-5,-1.5)}} + } + } +\end{figure} + +\autoref{fig:equiv_dive} presents the equivalence between the commands that calculate and draw the image using diverging lenses depending on the location of the object. + +\begin{figure}[!ht] + \centering + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussFixedCoord{2}{6}{1.5}{0.4}{2}{-4.2}{4.2}{(2,-1.5)}|} + \end{minipage}% + \begin{minipage}[c]{0.45\linewidth} + \centering{\tiny \verb|\lensSphGaussLFixedCoord{2}{-6}{1.5}{0.4}{2}{-4.2}{4.2}{(-4,-1.5)}|} + \end{minipage} + \captionbox{Equivalence between commands for diverging lenses\label{fig:equiv_dive}}[\linewidth]{ + \subcaptionbox{Command for object on the right}{ + \adjustbox{height=2.8cm}{\lensSphGaussFixedCoord{-2}{4}{1.2}{0.4}{2}{-2.5}{2.5}{(1,-1.5)}} + }\hfill + \subcaptionbox{Command for object on the left}{ + \adjustbox{height=2.8cm}{\lensSphGaussLFixedCoord{-2}{-4}{1.2}{0.4}{2}{-2.5}{2.5}{(-5,-1.5)}} + } + } +\end{figure} + +\subsection{Animation} + +\subsubsection{Convergent} + +\autoref{fig:anim_len_conv} presents an animation containing the movement of an object close to a converging lens. + +\begin{figure}[!ht] + \centering + \captionbox{Animation of object approaching a converging lens\label{fig:anim_len_conv}}[\linewidth]{ + \adjustbox{width=0.6\linewidth}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \lensSphGaussFixed[50]{2}{6-\rx}{2}{0.4}{11}{-12.5}{8.5} + } + \end{animateinline} + } + } +\end{figure} + +\subsubsection{Divergent} + +\autoref{fig:anim_len_dive} presents an animation containing the movement of an object close to a diverging lens. + +\begin{figure}[!ht] + \centering + \captionbox{Animation of object approaching a diverging lens\label{fig:anim_len_dive}}[\linewidth]{ + \adjustbox{width=0.6\linewidth}{ + \begin{animateinline}[poster=first, controls, palindrome, bb=-5 -5 50 50]{10} + \multiframe{100}{rx=0.5+0.05}{ + \lensSphGaussFixed[50]{-2}{6-\rx}{2}{0.4}{2.5}{-4.5}{6} + } + \end{animateinline} + } + } +\end{figure} + +\section{Other interesting packages} + +Below are interesting \textit{links} to other packages with optics implementations, as well as sources for the equations and modeling used. + +\begin{FHZmirroLensTcolorbox} + \begin{enumerate} + \item \href{https://tex.stackexchange.com/q/33460/140133}{\textbf{TeX StackExchange} -- TikZ library for optics?} + \item \href{https://tex.stackexchange.com/q/623201/140133}{\textbf{TeX StackExchange} -- Geometrical optics} + \item \href{https://ctan.org/pkg/tikz-optics}{{\textbf{CTAN}} -- tikz-optics} + \item \href{https://ctan.org/pkg/pst-mirror}{\textbf{CTAN} -- pst-mirror} + \item \href{https://ctan.org/pkg/simpleoptics}{\textbf{CTAN} -- simpleoptics} + + \item \href{https://youtu.be/efPZ5uSDeuI}{{\YouTube} -- The Organic Chemistry Tutor -- Spherical Mirrors \& The Mirror Equation - Geometric Optics} + \item \href{http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/mireq.html}{hyperphysics -- Spherical Mirror Equation} + + \item \href{http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/lenseq.html}{hyperphysics -- lenseq} + \item \href{https://www.plymouth.ac.uk/uploads/production/document/path/3/3754/PlymouthUniversity_MathsandStats_outreach_lenses.pdf}{plymouth -- lenses} + \item \href{https://www.khanacademy.org/science/in-in-class10th-physics/in-in-10th-physics-light-reflection-refraction/in-in-lens-formula-magnification/v/lens-formula}{khanacademy -- lens formula} + \end{enumerate} +\end{FHZmirroLensTcolorbox} + +\section{History and versions} + +\begin{FHZmirroLensTcolorbox} + \begin{enumerate}[leftmargin=3.5cm] + \item[1.0.0 (2022-12-24):] Package creation. + \end{enumerate} +\end{FHZmirroLensTcolorbox} + +\end{document} \ No newline at end of file diff --git a/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.cwl b/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.cwl new file mode 100644 index 0000000000..7aa1a6831c --- /dev/null +++ b/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.cwl @@ -0,0 +1,34 @@ + +% ====================== +% Developed by FHZ -- Brasil +% ====================== +#include:tikz + +% ======================================================= +% Summary of commands +% -- Mirrors +\mirrorSphGauss[arrows]{f}{p}{o}{epsilon}#n +\mirrorSphGaussCoord[arrows]{f}{p}{o}{epsilon}#n +\mirrorSphGaussFixed[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}#n +\mirrorSphGaussFixedCoord[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}{Co}#n +% -- Lens +\lensSphGauss[arrows]{f}{p}{o}{epsilon}#n +\lensSphGaussCoord[arrows]{f}{p}{o}{epsilon}#n +\lensSphGaussFixed[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}#n +\lensSphGaussFixedCoord[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}{Co}#n +% ======================================================= +\mirrorLensObjIma{p}{pp}{o}{i}#n +\mirrorLensCoord{p}{pp}{o}{i}{f}{Co}#n +% ======================================================= +\mirrorBase{f}{yM}{minXaxis}{maxXaxis}#n +\mirrorPts{v}{f}{c}#n +\mirrorRays{p}{pp}{o}{i}#n +% ======================================================= +\lensBase{f}{yM}{minXaxis}{maxXaxis}#n +\lensPts{v}{f}{c}#n +\lensRays{p}{pp}{o}{i}#n +% ======================================================= +\mirrorMath{f}{p}{o}{epsilon}{yM}#n +\lensMath{f}{p}{o}{epsilon}{yM}#n +\lensMathL{f}{p}{o}{epsilon}{yM}#n +% ======================================================= diff --git a/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.sty b/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.sty new file mode 100644 index 0000000000..cac1f21c2d --- /dev/null +++ b/graphics/pgf/contrib/tikz-mirror-lens/tex/tikz-mirror-lens.sty @@ -0,0 +1,524 @@ +% !TeX spellcheck = en_US +% !TeX encoding = UTF-8 +% ============================= + +\NeedsTeXFormat{LaTeX2e}[1994/06/01] +\ProvidesPackage{tikz-mirror-lens}[2022-12-25 Custom Package for drawing spherical mirrors and lens -- FHZ -- Version 1.0.0] + +\RequirePackage{tikz} +\usetikzlibrary{calc} +\usetikzlibrary{math} +\usetikzlibrary{decorations} +\usetikzlibrary{decorations.markings} + +% ======================================================= +% Variables +% f: focus of the mirror or lens +% p: position along x axis of the object +% pp: position along x axis of the object +% o: object height +% i: image height +% ymirror: mirror height +% epsilon: absolute distance between p and f +% yM: height of the mirror +% xL: Left extension of X axis +% xR: Right extension of X axis +% (x_C,y_C): Coordinates of the localization of displayed data +% arrows: optional argument to change arrows density +% ======================================================= + + +% ======================================================= +% Summary of main commands +% -- Mirrors +%\mirrorSphGauss[arrows]{f}{p}{o}{epsilon} +%\mirrorSphGaussCoord[arrows]{f}{p}{o}{epsilon} +%\mirrorSphGaussFixed[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR} +%\mirrorSphGaussFixedCoord[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)} +% -- Lens +%\lensSphGauss[arrows]{f}{p}{o}{epsilon} +%\lensSphGaussCoord[arrows]{f}{p}{o}{epsilon} +%\lensSphGaussFixed[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR} +%\lensSphGaussFixedCoord[arrows]{f}{p}{o}{epsilon}{yM}{xL}{xR}{(x_C,y_C)} +% ======================================================= + +% ======================================================= +% Mirrors and Lens -- Math +% ======================================================= +% Summary of commands +% \mirrorMath{f}{p}{o}{epsilon}{ymirror} +% \lensMath{f}{p}{o}{epsilon}{ymirror} +% \lensMathL{f}{p}{o}{epsilon}{ymirror} + +% ======================================================= +\newcommand{\mirrorMath}[5]{ + % Define mirror and object + \tikzmath{\f = #1; \v = 0; \c = 2*\f;} + \tikzmath{\p = #2; \o = #3;} + % Calculate image + \tikzmath{ + if (abs(\p - \f) >= #4) then { + \pp = \p*\f/(\p-\f); + \i = -(\pp/\p)*\o; + } else { + \pp = 0; + \i = 0; + }; + }; + % Mirror size, math as parameter + \tikzmath{\ymirror = #5;}; +} +\newcommand{\lensMath}[5]{ + % f > 0 convergente, f < 0 divergente + % Define lens and object + \tikzmath{\f = #1; \v = 0; \a = 2*\f;} + \tikzmath{\p = #2; \o = #3;} + % Calculate image + \tikzmath{ + if (abs(\p - \f) >= #4) then { + \pp = \p*(\f)/(\f-(\p)); + \i = (\pp/\p)*\o; + } else { + \pp = 0; + \i = 0; + }; + }; + % Lens size, math as parameter + \tikzmath{\ymirror = #5;}; +} +\newcommand{\lensMathL}[5]{ + % f > 0 convergente, f < 0 divergente + % Define lens and object + \tikzmath{\f = #1; \v = 0; \a = 2*\f;} + \tikzmath{\p = #2; \o = #3;} + % Calculate image + \tikzmath{ + if (abs(\p + \f) >= #4) then { + \pp = \p*\f/(\p+\f); + \i = (\pp/\p)*\o; + } else { + \pp = 0; + \i = 0; + }; + }; + % Lens size, math as parameter + \tikzmath{\ymirror = #5;}; +} +% ******************************************************* + +% ======================================================= +% Mirrors and Lens -- base +% ======================================================= +% Summary of commands +% \mirrorLensObjIma{p}{pp}{o}{i} +% \mirrorLensCoord{p}{pp}{o}{i}{f}{x} +% ======================================================= +\newcommand{\mirrorLensObjIma}[4]{ + \begin{scope}[-stealth] + \draw[green!50!black] (#1,0) node[above right]{$p$} -- ++(0,#3) node[above left]{$o$} coordinate(O); + \tikzmath{ + if (#2 != 0) then { + { + \draw[green] (#2,0) node[below left]{$p^{\prime}$} -- ++(0,#4) node[below left]{$i$}; + }; + }; + }; + \end{scope} +} +\newcommand{\mirrorLensCoord}[6]{ + \begin{scope} + \node[right] at #6 { + $\begin{aligned} + f & = #5 \\ + (p,o) & = (#1,#3) \\ + (p^{\prime},i) & = (#2,#4) + \end{aligned}$ + }; + \end{scope} +} +% ******************************************************* + +% ======================================================= +% Mirrors -- base +% ======================================================= +% Summary of commands +% \mirrorBase{f}{ymirror}{minEixoX}{maxEixoX} +% \mirrorPts{v}{f}{c} +% \mirrorRays{p}{pp}{o}{i} +% ======================================================= +\newcommand{\mirrorBase}[4]{ + \begin{scope} + \draw[dashed, extended line=15pt] (#3,0) -- (#4,0); + \foreach \ys in {1,-1}{ + \begin{scope}[yscale=\ys] + \draw[blue] (0,0) -- ++(0,#2) arc (0:-sign(#1)*90:{-sign(#1)*0.5}); + \foreach \x/\y in {0/0.05,0.05/0.20,0.15/0.35,0.45/0.5}{ + \draw[blue] ({sign(#1)*\x},#2+\y) -- ++({-0.5},0); + } + \end{scope} + } + \end{scope} +} +\newcommand{\mirrorPts}[3]{ + \begin{scope}[red] + \fill (#1,0) coordinate(V) circle(0.05) node[below left]{$V$}; + \fill (#2,0) coordinate(F) circle(0.05) node[below]{$f$}; + \fill (#3,0) coordinate(C) circle(0.05) node[below]{$c$}; + \end{scope} +} +\newcommand{\mirrorRays}[4]{ + \begin{scope}[thick,extended line=25pt] + \tikzmath{ + if (#2 != 0) then { + { + \draw[arrDec={#1},cyan] (#1,#3) -- (0,#3) -- (F) -- (#2,#4); + \draw[arrDec={#1-10},magenta] (O) -- (F) -- (0,#4) -- (#2,#4); + \draw[arrDec={#1-10},violet,dotted] (O) -- (V) -- (#2,#4); + }; + } else { + { + \draw[arrDec={#1},cyan] (#1,#3) -- (0,#3) -- (F); + \draw[arrDec={#1-10},violet,dotted] (O) -- (V) -- (#1,-#3); + }; + }; + }; + \end{scope} +} +% ******************************************************* + +% ======================================================= +% Lens - Base +% ======================================================= +% Summary of commands +% \lensBase{f}{ymirror}{minEixoX}{maxEixoX} +% \lensPts{v}{f}{a} +% \lensRays{p}{pp}{o}{i} +% ======================================================= +\newcommand{\lensBase}[4]{ + \begin{scope} + \draw[dashed, extended line=15pt] (#3,0) -- (#4,0); + \foreach \ys in {1,-1}{ + \begin{scope}[yscale=\ys] + \draw[blue] (0,0) -- ++(0,#2);% arc (0:-sign(\f)*90:{-sign(\f)*0.5}); + \draw[blue, fill=white] (0,#2) -- ++(0.25,0) -- ++(-0.25,{sign(#1)*0.25}) -- ++(-0.25,{-sign(#1)*0.25}) -- cycle; + \end{scope} + } + \end{scope} +} +\newcommand{\lensPts}[3]{ + \begin{scope}[red] + \fill (#1,0) coordinate(V) circle(0.05) node[below left]{$V$}; + \fill (#2,0) coordinate(F) circle(0.05) node[below]{$f_o$}; + \fill (#3,0) coordinate(C) circle(0.05) node[below]{$A_0$}; + \fill (-#2,0) coordinate(Fi) circle(0.05) node[below]{$f_i$}; + \fill (-#3,0) coordinate(Ci) circle(0.05) node[below]{$A_i$}; + \end{scope} +} +\newcommand{\lensRays}[4]{ + \begin{scope}[thick,extended line=25pt] + \tikzmath{ + if (\pp != 0) then { + { + \draw[arrDec={#1},cyan] (\p,\o) -- (0,\o) -- (Fi) -- (\pp,\i); + \draw[arrDec={#1-10},magenta] (O) -- (F) -- (0,\i) -- (\pp,\i); + \draw[arrDec={#1-10},violet,dotted] (O) -- (V) -- (\pp,\i); + }; + } else { + { + \draw[arrDec={#1},cyan] (\p,\o) -- (0,\o) -- (Fi); + \draw[arrDec={#1-10},violet,dotted] (O) -- (V) -- (-\p,-\o); + }; + }; + }; + \end{scope} +} +% ******************************************************* + +% ======================================================= +% Mirrors +% ======================================================= +\newcommand{\mirrorSphGauss}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \mirrorMath{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Mirror, Notable points, Object and image, Notable Rays, Coordinates + \mirrorBase{\f}{\ymirror}{{min(\v,\pp,\c)}}{{max(\c+0.5,\p,\pp)}} + \mirrorPts{\v}{\f}{\c} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \mirrorRays{\p}{\pp}{\o}{\i} + \end{tikzpicture} +} +\newcommand{\mirrorSphGaussCoord}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \mirrorMath{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Mirror, Notable points, Object and image, Notable Rays, Coordinates + \mirrorBase{\f}{\ymirror}{{min(\v,\pp,\c)}}{{max(\c+0.5,\p,\pp)}} + \mirrorPts{\v}{\f}{\c} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \mirrorRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{({max(\c+0.5,\p,\pp)+1},-1)} + \end{tikzpicture} + } +\newcommand{\mirrorSphGaussFixed}[8][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \mirrorMath{#2}{#3}{#4}{#5}{#6} + % Mirror, Notable points, Object and image, Notable Rays, Coordinates + \mirrorBase{\f}{\ymirror}{#7}{#8} + \mirrorPts{\v}{\f}{\c} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \mirrorRays{\p}{\pp}{\o}{\i} + \end{tikzpicture} +} +\newcommand{\mirrorSphGaussFixedCoord}[9][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \mirrorMath{#2}{#3}{#4}{#5}{#6} + % Mirror, Notable points, Object and image, Notable Rays, Coordinates + \mirrorBase{\f}{\ymirror}{#7}{#8} + \mirrorPts{\v}{\f}{\c} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \mirrorRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{#9} + \end{tikzpicture} +} +% ******************************************************* + +% ======================================================= +% Lens +% ======================================================= +\newcommand{\lensSphGauss}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMath{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{{min(\v,\pp,\a)}}{{max(\a+0.5,\p,\pp)}} + \lensPts{\v}{\f}{\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + %\mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{{max(\a+0.5,\p,\pp)}+1} + \end{tikzpicture} +} +\newcommand{\lensSphGaussCoord}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMath{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{{min(\v,\pp,\a)}}{{max(\a+0.5,\p,\pp)}} + \lensPts{\v}{\f}{\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{({max(\a+0.5,\p,\pp)+1},-1)} + \end{tikzpicture} +} +\newcommand{\lensSphGaussFixed}[8][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMath{#2}{#3}{#4}{#5}{#6} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{#7}{#8} + \lensPts{\v}{\f}{\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \end{tikzpicture} +} +\newcommand{\lensSphGaussFixedCoord}[9][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMath{#2}{#3}{#4}{#5}{#6} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{#7}{#8} + \lensPts{\v}{\f}{\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{#9} + \end{tikzpicture} +} +% ******************************************************* + +% ======================================================= +% Lens - L +% ======================================================= +\newcommand{\lensSphGaussL}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMathL{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{{min(\v,\p,\pp,\a,-\a)}}{{max(\v,\p,\pp,\a,-\a)}} + \lensPts{\v}{-\f}{-\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + %\mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{{max(\a+0.5,\p,\pp)}+1} + \end{tikzpicture} +} +\newcommand{\lensSphGaussLCoord}[5][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMathL{#2}{#3}{#4}{#5}{max(abs(\o),abs(\i)) + 0.5} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{{min(\v,\p,\pp,\a,-\a)}}{{max(\v,\p,\pp,\a,-\a)}} + \lensPts{\v}{-\f}{-\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{({max(\v,\p,\pp,\a,-\a)},-1)} + \end{tikzpicture} +} +\newcommand{\lensSphGaussLFixed}[8][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMathL{#2}{#3}{#4}{#5}{#6} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{#7}{#8} + \lensPts{\v}{-\f}{-\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \end{tikzpicture} +} +\newcommand{\lensSphGaussLFixedCoord}[9][60]{ + \begin{tikzpicture}[very thick, + arrDec/.style={ + decoration={ + markings, + mark= between positions 0.1 and 0.99 step #1pt with {\arrow{latex}} + }, + postaction={decorate}, + }, + arrDec/.default=20, + extended line/.style={shorten >=-#1,shorten <=-#1}, + extended line/.default=1cm + ] + % Math + \lensMathL{#2}{#3}{#4}{#5}{#6} + % Lens, Notable points, Object and image, Notable Rays, Coordinates. + \lensBase{\f}{\ymirror}{#7}{#8} + \lensPts{\v}{-\f}{-\a} + \mirrorLensObjIma{\p}{\pp}{\o}{\i} + \lensRays{\p}{\pp}{\o}{\i} + \mirrorLensCoord{\p}{\pp}{\o}{\i}{\f}{#9} + \end{tikzpicture} +} +% ******************************************************* + +\endinput \ No newline at end of file -- cgit v1.2.3