From e63759bc8ac77f2a41375c1f4b0ad538d4da86b0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 15 Nov 2018 22:21:11 +0000 Subject: pst-moire (15nov18) git-svn-id: svn://tug.org/texlive/trunk@49167 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-moire/README.md | 52 +- .../generic/pst-moire/examples/psGlassPattern.pdf | Bin 0 -> 1868912 bytes .../generic/pst-moire/examples/psGlassPattern.tex | 38 + .../doc/generic/pst-moire/pst-cosine.pro | 31 + .../doc/generic/pst-moire/pst-moire-doc.pdf | Bin 2173596 -> 4864569 bytes .../doc/generic/pst-moire/pst-moire-doc.tex | 1695 +++++++++++++++++--- .../texmf-dist/doc/generic/pst-moire/pst-sin.pro | 26 + 7 files changed, 1614 insertions(+), 228 deletions(-) create mode 100644 Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.pdf create mode 100644 Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.tex create mode 100644 Master/texmf-dist/doc/generic/pst-moire/pst-cosine.pro create mode 100644 Master/texmf-dist/doc/generic/pst-moire/pst-sin.pro (limited to 'Master/texmf-dist/doc/generic/pst-moire') diff --git a/Master/texmf-dist/doc/generic/pst-moire/README.md b/Master/texmf-dist/doc/generic/pst-moire/README.md index c7a5ef8937f..41dfff0e5c6 100644 --- a/Master/texmf-dist/doc/generic/pst-moire/README.md +++ b/Master/texmf-dist/doc/generic/pst-moire/README.md @@ -1,6 +1,6 @@ # **README** # -# pst-moire v. 1.0 # -# 2018/10/28 # +# pst-moire v. 2.0 # +# 2018/11/16 # Source: pst-moire.tex, pst-moire.sty, pst-moire.pro Authors: Jürgen Gilg, Manuel Luque, Jean-Michel Sarlat @@ -16,6 +16,54 @@ a variety of patterns obtained either by dragging one pattern on another, or by rotating one on the other. Moire effects sometimes look very interesting. This document provides the necessary commands and divers examples. +--- + +# **CHANGES COMPARED TO VERSION 1.0** # + +The documentation is better structured and there were added some more +explanations for each type of moiré + +--- + +The **type=circle** gets two new keys to be more flexible: + + n Number of circles + T Distance between two adjacent circles in mm + +The key **Rmax** is therefore out of effect. The image width/height is now +calculated by *n x T*. + +Scaling can be done by setting the usual PSTricks key **unit=**. + +--- + +The **type=linear** gets two new keys to be more flexible: + + n Number of the lines -1 + T Distance between the middle two adjacent lines in mm + +The key **2 \* Rmax** is the height of the lines. The image width is now +calculated by *n x T*. + +--- + +Adding a new command **\\addtomoirelisttype** + +This is to generate customers patterns to then be used as **type=...** + +--- + +Adding a new section: **Random moirés** + +Showing the effects that occur, when randomly placed dots within a square +overlap by the actions rotation or magnification or both of them. + +Adding a new command **\\psRandomDot** + +--- + +Adding a new section: **Glass-patterns** +Adding a new command **\\psGlassPattern** diff --git a/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.pdf b/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.pdf new file mode 100644 index 00000000000..a9a97c4477d Binary files /dev/null and b/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.tex b/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.tex new file mode 100644 index 00000000000..cea77b6da90 --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-moire/examples/psGlassPattern.tex @@ -0,0 +1,38 @@ +\documentclass{article} +\usepackage[a4paper,margin=2cm]{geometry} +\usepackage{pst-moire} +\begin{document} +% la couleur des points du premier calque est choisie avec [linecolor=...] +% la couleur des points du second calque est choisie avec [fillcolor=...] +% function : variable = t +% layer=true : 2 layers displayed , false=> layer 1 only +Problem page 100 : "\emph{The Theory of the Moire Phenomenon}" Volume II, by I. Amidror, published by Springer, + +\textbf{3-18 }\emph{Synthesis of a layer superposition having a predefined fixed locus.} + +\begin{quote}\itshape +``Design layer transformations $\mathbf{g}_1(x,y)$ and $\mathbf{g}_2(x,y)$ that will produce in the superposition of two initially identical random screens a fixed locus consisting of a star-like curve that surrounds the origin as shown in the figure on the front cover of this book. Hint: In this case, you may consider a top-opened conic surface having star-like level lines, such as $z=r(1+0.5\cos5\theta)$, or, possibly, $z=r/(1+0.5\cos5\theta)$, which gives a slightly different star. You may adjust the orientation of the star by replacing $\cos$ by $\sin$ or by $-\sin$, as seems suitable. In order to have this surface intersect the $x,y$ plane along a star, you need to lower it by some constant $z_0$: $z=r(1+0.5\cos5\theta)-z_0$. But if you wish to obtain a more complex surface that intersects the $x,y$ plane on a family of concentric stars, you may consider a surface such as: $z=\sin(r(1+0.5\cos5\theta))$.'' +\end{quote} + +\begin{pspicture}(-8,-8)(8,8) +\psframe*[linecolor=orange](-8,-8)(8,8) +% z=5*r*(1-0.5*sin(5*t*Pi/180))-2.5 +\psGlassPattern[linecolor=red] +\end{pspicture} + +\begin{pspicture}(-8,-8)(8,8) +\psframe*[linecolor=red](-8,-8)(8,8) +% in algebraic notation +% t in degrees, argument sin and cos in radians +% convert *Pi/180 +\psGlassPattern[unit=0.75,dotsize=1pt,dotstyle=square,linecolor={[rgb]{0 0 0.5}},algebraic,function=5*r*(1-0.5*cos(7*t*Pi/180))-2.5] +\end{pspicture} + +\begin{pspicture}(-9,-9)(9,9) +\psframe*[linecolor=cyan](-9,-9)(9,9) +% in algebraic notation +% t in degrees, argument sin and cos in radians +% convert *Pi/180 +\psGlassPattern[unit=1.1,dotsize=1pt,dotstyle=square*,linecolor=black,fillcolor=cyan,algebraic,function=5*r/(1-0.75*sin(5*t*Pi/180))-2.5]% ,layers=false +\end{pspicture} +\end{document} diff --git a/Master/texmf-dist/doc/generic/pst-moire/pst-cosine.pro b/Master/texmf-dist/doc/generic/pst-moire/pst-cosine.pro new file mode 100644 index 00000000000..aff0c34dd2b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-moire/pst-cosine.pro @@ -0,0 +1,31 @@ +moireDict begin +/pst-cosine { +/amplitud 2.5 def +/period 2 def +/cos1 [ +-8 0.05 8 {/x exch def % 320 pts + x unit + 360 x mul period div cos amplitud mul + } for +] def +% +/drawcos { +newpath +cos1 0 get cos1 1 get moveto +0 2 cos1 length 2 sub {/i exch def + cos1 i get cos1 i 1 add get lineto + } for + stroke +} def +gsave +Runit neg dup +Runit 2 mul dup +rectclip +0 -8 unit translate +nr { + 0 E1 translate + drawcos +} repeat +grestore +} def +end diff --git a/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.pdf b/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.pdf index 925577f7495..b3b31618533 100644 Binary files a/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.pdf and b/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.tex b/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.tex index 5e0facd85d4..40601c8e130 100644 --- a/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-moire/pst-moire-doc.tex @@ -54,16 +54,9 @@ \definecolor{moire2}{rgb}{0.357,0.525,0.13} \definecolor{moire3}{rgb}{0.2,0.05,0.015} \definecolor{moire4}{rgb}{0.070.41 0.255} -\definecolor{Beige} {rgb}{0.96,0.96,0.86} -\definecolor{GrisClair} {rgb}{0.8,0.8,0.8} -\definecolor{GrisTresClair} {rgb}{0.9,0.9,0.9} -\definecolor{OrangeTresPale}{cmyk}{0,0.1,0.3,0} -\definecolor{OrangePale}{cmyk}{0,0.2,0.4,0} -\definecolor{BleuClair}{cmyk}{0.2,0,0,0} -\definecolor{LightBlue}{rgb}{.68,.85,.9} -\definecolor{DarkGreen}{rgb}{0,.85,0} -\definecolor{Copper}{cmyk}{0,0.9,0.9,0.2} + \DeclareSymbolFont{grecquesdroites}{U}{eur}{m}{n} + \DeclareMathSymbol{\BETA}{\mathord}{grecquesdroites}{12} \DeclareMathSymbol{\DELTA}{\mathord}{grecquesdroites}{14} \DeclareMathSymbol{\EPSILON}{\mathord}{grecquesdroites}{15} @@ -83,13 +76,17 @@ \psmoire[type=Gauss,linecolor=red,scale=0.6,rotate=-20] \end{pspicture}} - \let\belowcaptionskip\abovecaptionskip \parindent0pt +\pstheader{pst-sin.pro} +\addtomoirelisttype{sin} +\pstheader{pst-cosine.pro} +\addtomoirelisttype{cosine} + \begin{document} -\title{pst-moire v 1.0} +\title{pst-moire v. 2.0} \subtitle{A PSTricks package to draw moiré patterns} \author{% Jürgen \textsc{Gilg}\\ @@ -102,7 +99,6 @@ \tableofcontents \psset{unit=1cm} - \clearpage \begin{abstract}\parskip4pt\parindent0pt @@ -111,7 +107,6 @@ The \texttt{pst-moire} package makes it possible to very simply create a variety For the interested user, we present a section \textbf{Theory} (see pages~\pageref{sec:theory}-\pageref{sec:theoryEnd}) for the mathematical background of moiré patterns. - \vfill {\small This program can redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory \texttt{macros/latex/base/lppl.txt}; either version 1.3c of the License, or (at your option) any later version.} @@ -134,7 +129,7 @@ For the interested user, we present a section \textbf{Theory} (see pages~\pagere \begin{pspicture}(-3,-3)(3,4) \rput(0,-3){\colorbox{black}{\textcolor{white}{\texttt{type=linear}}}} \rput(0,3){\texttt{Equidistant lines}} -\psmoire[linecolor=blue,type=linear] +\psmoire[type=linear,n=28,T=2,Rmax=2.7,linecolor=blue,scale=1] \end{pspicture} \begin{pspicture}(-3,-3)(3,4) @@ -146,7 +141,8 @@ For the interested user, we present a section \textbf{Theory} (see pages~\pagere \begin{pspicture}(-3,-3)(3,4) \rput(0,-3){\colorbox{black}{\textcolor{white}{\texttt{type=circle}}}} \rput(0,3){\texttt{Concentric circles}} -\psmoire[linecolor=cyan,type=circle] +\psset{unit=0.4} +\psmoire[linecolor=cyan,type=circle,scale=0.5] \end{pspicture} \begin{pspicture}(-3,-3)(3,4) @@ -196,7 +192,7 @@ For the interested user, we present a section \textbf{Theory} (see pages~\pagere \Lcs{psmoire}\OptArgs\Largr{x , y} \end{BDef} -The command \Lcs{psmoire} contains the options \nxLkeyword{type=}, \nxLkeyword{Rmax=}, \nxLkeyword{scale=}, \nxLkeyword{Alpha=}, \nxLkeyword{rotate=}, and \nxLkeyword{E=}. +The command \Lcs{psmoire} contains the options \nxLkeyword{type=}, \nxLkeyword{Rmax=}, \nxLkeyword{scale=}, \nxLkeyword{Alpha=}, \nxLkeyword{rotate=}, \nxLkeyword{E=}, \nxLkeyword{n=} and \nxLkeyword{T=}. The optional argument \Largr{x , y} gives the \texttt{x} and \texttt{y} center of the image. If not chosen $(0,0)$ is taken by default. @@ -204,13 +200,30 @@ The optional argument \Largr{x , y} gives the \texttt{x} and \texttt{y} center o \begin{quote} \begin{tabularx}{\linewidth}{ @{} l >{\ttfamily}l X @{} }\toprule -\textbf{Name} & \textbf{Default} & \textbf{Meaning} \\\midrule +\textbf{Name} & \textbf{Default} & \textbf{Meaning}\\\midrule \Lkeyword{type} & Fresnel & The type of pattern\\ -\Lkeyword{Rmax} & 6 & The largest radius of the circles (in cm)\\ -\Lkeyword{scale} & 1 & Scaling factor for the image\\ -\Lkeyword{Alpha} & 70 & Slope of the lines for \verb+[type=Gauss]+\\ -\Lkeyword{rotate} & 0 & Rotation of the figure in degrees.\\ -\Lkeyword{E} & 0.25& Distance between two lines for \verb+[type=Gauss]+\\ +%% +\Lkeyword{rotate} & 0 & Rotation angle of the pattern (in degrees).\\ +%% +\Lkeyword{Rmax} & 6 & For \verb+type=Gauss+ -- image dimensions: \verb+(-Rmax,-Rmax)*(Rmax,Rmax)+\\ + & & For \verb+type=linear+ -- \verb+2*Rmax+ is the length of the lines\\ + & & For \verb+type=radial+ -- maximal radii length\\ + & & all (in cm)\\ +%% +\Lkeyword{scale} & 1 & Scaling factor for the image\\ + & & available for the types: \verb+type=Fresnel/Gauss/Newton/dot/chess+\\ +%% +\Lkeyword{Alpha} & 70 & Slope of the lines (in degrees): \\ + & & for \verb+type=Gauss+ only\\ +%% +\Lkeyword{E} & 0.25 & x-Distance between two points on the Gaussian curve (in cm): \\ + & & for \verb+type=Gauss+ only\\ +%% +\Lkeyword{n} & 30 & Number of circles/lines: \\ + & & for \verb+type=circle+, \verb+type=linear+ only.\\ +%% +\Lkeyword{T} & 2 & Distance between two adjacent circles/lines (in mm): \\ + & & for \verb+type=circle+, \verb+type=linear+ only.\\ \bottomrule \end{tabularx} \end{quote} @@ -225,52 +238,321 @@ We set the type of pattern like: \texttt{type=Gauss} (for example). \psmoire[options,type=Gauss](x,y) \end{verbatim}} -If no position coordinate is specified, the center of the image is placed at $(0,0)$. The thickness parameter does not effect the following types: +For the types that are not affected by \texttt{scale}, simply use the PSTricks key \verb+unit=+. + +If no position coordinate is specified, the center of the image is placed at $(0,0)$. The PSTricks thickness key \verb+linewidth=+ does not affect the following types: \verb+Fresnel+, \verb+Newton+ and \verb+radial+ \newpage +\section{The command \Lcs{addtomoirelisttype}} + +\begin{BDef} +\Lcs{addtomoirelisttype}\Largb{name} +\end{BDef} + +The command \Lcs{addtomoirelisttype} only comes with one mandatory argument---the name the customer chooses. + +If we like to generate our own pattern we can achieve this by using the command \\ +\Lcs{addtomoirelisttype}\Largb{name} within the preamble which then references to a file named +\begin{verbatim} +pst-name.pro +\end{verbatim} +where the prefix \verb+pst-+ is automatically generated. This file we need to code ourselves in PostScript language, save within the working folder and then load it within the preamble like +\begin{verbatim} +\pstheader{pst-name.pro} +\addtomoirelisttype{name} +\end{verbatim} + + +\subsection{How to make a custom moiré types} + +\subsubsection{Sinosoidal pattern} + +\[ +y=a\sin(2\pi\frac{x}{T}) +\] +\begin{center} +\begin{pspicture}[showgrid](-4,-3)(4,3) +\pstVerb{/amplitude 1 def /periode 6.28318530718 def}% +\psplot[plotpoints=1000,algebraic]{-4}{4}{amplitude*sin(2*Pi*x/periode)} +\end{pspicture} +\end{center} +For the grating of equidistant vertical lines we have: $x=ne$, $e$ displacement and $n$ an integer. + +The ordinates of the intersection points are: $y_n=a\sin(2\pi\frac{ne}{T})$. Within the following figure, the displacement is set to 0.25. +\begin{center} +\begin{pspicture}[showgrid](-4,-3)(4,3) +\pstVerb{/amplitude 1 def /periode 6.28318530718 def}% +\psplot[plotpoints=1000,algebraic]{-4}{4}{amplitude*sin(2*Pi*x/periode)} +\psplot[plotpoints=33,algebraic,linestyle=none,showpoints]{-4}{4}{amplitude*sin(2*Pi*x/periode)}% +\multido{\r=-4+0.25}{33}{ +\psline(\r,-3)(\r,3)} +\end{pspicture} +\end{center} +We determine the equations of the straight lines passing through these points and which are inclined by an angle $\alpha$ with respect to the horizontal. This is to setup with the key \texttt{Alpha=} (in degrees). + +The general equation of such a line is given by: $y=x\tan(\alpha)+b$, we determine $b$ to go through one of the previous points. +\[ +ne\tan(\alpha)+b=a\sin(2\pi\frac{ne}{T}) +\] +and thus we get $b$. +\[ +b=a\sin(2\pi\frac{ne}{T})-ne\tan(\alpha) +\] +For every value of $n$ we receive one line. +\[ +y=x\tan(\alpha)+a\sin(2\pi\frac{ne}{T})-ne\tan(\alpha) +\] +We draw some lines, setting $a=1$, $T=2\pi$, $-20}(0,0){2}{0}{50} +\rput(1.25;25){\textcolor{red}{\texttt{\textbf{Alpha}}}} +} +\psmoire[Rmax=4,type=Gauss,Alpha=50] +\end{pspicture} +{\small\begin{verbatim} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[Rmax=4,type=Gauss,Alpha=50] +\end{pspicture} +\end{verbatim}} +\end{minipage} +\hfill +\begin{minipage}[t]{8cm}\kern0pt +\begin{pspicture}(-4,-4)(4,4) +\psmoire[Rmax=4,type=Gauss,Alpha=50,E=0.5] +\end{pspicture} +{\small\begin{verbatim} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[Rmax=4,type=Gauss,Alpha=50,E=0.5] +\end{pspicture} +\end{verbatim}} +\end{minipage} + +\bigskip + +\textbf{Example 2: Overlapping patterns} + +\begin{minipage}[t]{8cm}\kern0pt +\psset{linewidth=0.5mm,Rmax=4} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[type=Gauss,rotate=-5,linecolor=red] +\psmoire[type=Gauss,rotate=5] +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{8cm}\kern0pt +{\small\begin{verbatim} +\psset{linewidth=0.5mm,Rmax=4} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[type=Gauss,rotate=-5,linecolor=red] +\psmoire[type=Gauss,rotate=5] +\end{pspicture} +\end{verbatim}} +\end{minipage} + + +\newpage + + +\subsection{\texttt{type=square}} + +The \texttt{type=square} consists of equidistant squares with a distance 2 mm each. + +\textbf{Example 1:} + +The following moiré is given by a superposition of two square gratings when both gratings are rotated by $+/-5^\circ$ around its origin. + +\begin{center} +\psset{linewidth=1mm,scale=0.6} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[type=square,rotate=-5] +\psmoire[type=square,rotate=5] +\end{pspicture} +\end{center} +{\small\begin{verbatim} +\psset{linewidth=1mm,scale=0.6} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[type=square,rotate=-5] +\psmoire[type=square,rotate=5] +\end{pspicture} +\end{verbatim}} + + +\newpage + + +\subsection{\texttt{type=Newton}} + +The \texttt{type=Newton} consists of concentric squares with incrementing side length of $\sqrt{n}$. The maximum side length is given by \texttt{Rmax}. The linewidth is fixed (cannot be changed by \texttt{linewidth=}), due to the thickness of the squares varies. + +\textbf{Example 1:} + +The following moiré is given by a superposition of two Newton gratings when both gratings are rotated by $+/-2.5^\circ$ around its origin. + +\begin{center} +\psset{linewidth=0.5mm,scale=0.5} +\begin{pspicture}(-4,-4)(4,4) +\psmoire[type=Newton,rotate=-2.5] +\psmoire[type=Newton,rotate=2.5] +\end{pspicture} +\end{center} +{\small\begin{verbatim} +\psset{linewidth=0.5mm,scale=0.5} \begin{pspicture}(-4,-4)(4,4) -\psmoire[linecolor=green,scale=0.5](-1.5,0) -\psmoire[linecolor=green,scale=0.5](1.5,0) +\psmoire[type=Newton,rotate=-2.5] +\psmoire[type=Newton,rotate=2.5] +\end{pspicture} +\end{verbatim}} + + +\newpage + + +\subsection{\texttt{type=dot}} + +The \texttt{type=dot} consists of dots bordered within a square of side lengths \texttt{Rmax*Rmax}. The \texttt{dotstyle=} and \texttt{dotsize=} can be individually setup. Its colors can be chosen by the usual PSTricks key \texttt{linecolor}. + +\textbf{Example 1:} + +The following moiré is given by a superposition of two dot gratings when both gratings are rotated by $+/-2.5^\circ$ around its origin. + +\begin{center} +\psset{Rmax=4} +\begin{pspicture}(-4,-4)(4,5) +\psmoire[type=dot,linecolor=blue,rotate=-2.5] +\psmoire[type=dot,rotate=2.5,linecolor=red] \end{pspicture} +\end{center} +{\small\begin{verbatim} +\psset{Rmax=4} +\begin{pspicture}(-5,-5)(5,5) +\psmoire[type=dot,linecolor=blue,rotate=-2.5] +\psmoire[type=dot,rotate=2.5,linecolor=red] +\end{pspicture} +\end{verbatim}} + + +\newpage + + +\subsection{\texttt{type=chess}} + +The \texttt{type=chess} consists of squares bordered within a square of side lengths \texttt{Rmax*Rmax}. The \texttt{dotstyle=} and \texttt{dotsize=} can be individually setup. Its colors can be chosen by the usual PSTricks key \texttt{linecolor}. + +\textbf{Example 1:} + +The following moiré is given by a superposition of two chess gratings when both gratings are rotated by $+/-5^\circ$ around its origin. + +\begin{center} +\psset{Rmax=4,dotstyle=square*,dotsize=0.25cm,linecolor={[cmyk]{0 0.81 1 0.6}}} +\begin{pspicture}(-4,-4)(4,5) +\psmoire[type=chess,rotate=-5] +\psmoire[type=chess,rotate=5] +\end{pspicture} +\end{center} +{\small\begin{verbatim} +\psset{Rmax=4,dotstyle=square*,dotsize=0.25cm} +\begin{pspicture}(-4,-4)(4,5) +\psmoire[type=chess,rotate=-5] +\psmoire[type=chess,rotate=5] +\end{pspicture} +\end{verbatim}} + + +\newpage + + +\section{Examples of combined moiré patterns} + +\textbf{Example 1:} + +\begin{minipage}[t]{6cm}\kern0pt +\psset{Rmax=8,linewidth=0.5mm,scale=0.5, +linecolor={[rgb]{0.357 0.525 0.13}}} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Fresnel + type=linear}} +\psmoire[type=Fresnel] +\psmoire[type=linear,n=40] +\psmoire[type=linear,n=41](-0.1,0) +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt +{\footnotesize\begin{verbatim} +\psset{Rmax=8,linewidth=0.5mm,scale=0.5, +linecolor={[rgb]{0.357 0.525 0.13}}} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Fresnel + type=linear}} +\psmoire[type=Fresnel] +\psmoire[type=linear,n=40] +\psmoire[type=linear,n=41](-0.1,0) +\end{pspicture} +\end{verbatim}} +\end{minipage} + +\bigskip + +\textbf{Example 2:} + +\begin{minipage}[t]{6cm}\kern0pt +\psset{Rmax=8,linewidth=0.5mm,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Fresnel + type=square}} +\psmoire[type=Fresnel,linecolor=orange] +\psmoire[type=square,linecolor=gray] +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt +{\footnotesize\begin{verbatim} +\psset{Rmax=8,linewidth=0.5mm,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Fresnel + type=square}} +\psmoire[type=Fresnel,linecolor=orange] +\psmoire[type=square,linecolor=gray] +\end{pspicture} +\end{verbatim}} +\end{minipage} + + +\newpage + + +\textbf{Example 3:} + +\begin{minipage}[t]{6cm}\kern0pt +\psset{Rmax=8,linewidth=0.5mm,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Newton + type=square}} +\psmoire[type=Newton,linecolor=blue,rotate=5] +\psmoire[type=square,linecolor=cyan,rotate=-5] +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt +{\footnotesize\begin{verbatim} +\psset{Rmax=8,linewidth=0.5mm,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\rput(0,4.75){\texttt{type=Newton + type=square}} +\psmoire[type=Newton,linecolor=blue,rotate=5] +\psmoire[type=square,linecolor=cyan,rotate=-5] +\end{pspicture} +\end{verbatim}} +\end{minipage} + +\bigskip + +\textbf{Example 4:} + +\begin{minipage}[t]{6cm}\kern0pt +\psset{Rmax=8,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\pstVerb{% +/Multiply .setblendmode +} +\rput(0,4.75){\texttt{type=Fresnel + type=Newton}} +\psmoire[% +type=Fresnel, +linecolor=gray +](-0.05,0) +\psmoire[% +type=Newton, +linecolor=gray!30, +rotate=5 +](0.05,0) +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt +{\footnotesize\begin{verbatim} +\psset{Rmax=8,scale=0.5} +\begin{pspicture}(-5,-5)(5,5) +\pstVerb{% +/Multiply .setblendmode +} +\rput(0,4.75){\texttt{type=Fresnel + type=Newton}} +\psmoire[% +type=Fresnel, +linecolor=gray +](-0.05,0) +\psmoire[% +type=Newton, +linecolor=gray!30, +rotate=5 +](0.05,0) +\end{pspicture} +\end{verbatim}} +\end{minipage} + + +\newpage + + +These following rotating moirés were obtained with the use of the \texttt{pst-lens} package. It is the reproduction, with the tools of PSTricks, of the image 6, page 137 of the book ``\textit{Les phénomènes naturels}'' of the Library \textit{Pour la Science}, Berlin (1978). This image is accompanied by the following comment: +\begin{quote}\itshape +<<~Ces moirés tournants apparaissent quand les lentilles placées sur une trame et observées avec une autre trame identique à la première. La grosse lentille (convergente) réduit la trame inférieure, tandis que la petite lentille (divergente) la grossit. En conséquence, les moirés obtenus ont des sens de rotation opposés. Une figure de moiré ondulée traduit la présence d'aberrations optiques dans la lentille.~>> +\end{quote} + +\textbf{Animation:} Big lens: magnification of 1.2, small lens: magnification of 0.8 + +\begin{center} +\begin{animateinline}[controls,palindrome, + begin={\begin{pspicture}(-7,-7)(7,7)}, + end={\end{pspicture}}]{10}% 10 image/s +\multiframe{20}{i=-10+1}{% +\psset{LensHandle=false,LensShadow=false} +\psset{linecolor=red,linewidth=0.1,type=linear,n=60} +\psmoire% +\PstLens[LensMagnification=1.2,LensSize=2](1,1.5){\psmoire} +\PstLens[LensMagnification=0.8,LensSize=1.5](-2,-2){\psmoire} +\psmoire[linecolor=black,rotate=\i]} +\end{animateinline} +\end{center} +{\tiny\begin{verbatim} +\begin{animateinline}[controls,palindrome, + begin={\begin{pspicture}(-7,-7)(7,7)}, + end={\end{pspicture}}]{10}% 10 image/s +\multiframe{20}{i=-10+1}{% +\psset{LensHandle=false,LensShadow=false} +\psset{linecolor=red,linewidth=0.1,type=linear,n=60} +\psmoire% +\PstLens[LensMagnification=1.2,LensSize=2](1,1.5){\psmoire} +\PstLens[LensMagnification=0.8,LensSize=1.5](-2,-2){\psmoire} +\psmoire[linecolor=black,rotate=\i]} +\end{animateinline} \end{verbatim}} \newpage +\section{Random moirés} + +\subsection{The command \Lcs{psRandom} (from \texttt{pstricks-add})} + +See the impressing examples of Emin Gabrielyan: \begin{center} -\begin{pspicture}(-4,-4)(4,4) -\rput(0,4){\textsf{Lines}} -\psmoire[scale=0.5,type=linear,rotate=5,linewidth=0.1] -\psmoire[scale=0.5,type=linear,rotate=-5,linewidth=0.1] -\end{pspicture} +\url{https://docs.switzernet.com/people/emin-gabrielyan/070212-random-moire} \end{center} +Here we present his first example the PSTricks way and some other random moirés as well---the package \texttt{pstricks-add} is required however: + +\bigskip + +\textbf{Example 1: Concentric circles} + +\begin{minipage}[t]{9cm}\kern0pt +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=red, +linecolor=red, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{4}(0,0){\myPattern} +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt {\small\begin{verbatim} -\begin{pspicture}(-4,-4)(4,4) -\psmoire[scale=0.5,type=linear,rotate=5,linewidth=0.1] -\psmoire[scale=0.5,type=linear,rotate=-5,linewidth=0.1] +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=red, +linecolor=red, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{4}(0,0){\myPattern} \end{pspicture} \end{verbatim}} -% -\begin{center} -\begin{pspicture}(-4,-4)(4,4.5) -\rput(0,4.25){\textsf{Radii}} -\psmoire[Rmax=4,type=radial](-0.25,0) -\psmoire[Rmax=4,type=radial](0.25,0) +\end{minipage} + +\bigskip + +\textbf{Example 2: Spiral} + +\begin{minipage}[t]{9cm}\kern0pt +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=blue, +linecolor=blue, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{4}(0,0){\psset{xunit=1.05,yunit=1.05}\myPattern} \end{pspicture} -\end{center} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt {\small\begin{verbatim} -\begin{pspicture}(-4,-4)(4,4) -\psmoire[Rmax=4,type=radial](-0.25,0) -\psmoire[Rmax=4,type=radial](0.25,0) -\end{pspicture} +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=blue, +linecolor=blue, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{4}(0,0){% +\psset{xunit=1.05,yunit=1.05} +\myPattern} +\end{pspicture +} \end{verbatim}} +\end{minipage} \newpage -\begin{center} -\psset{scale=0.7,linewidth=0.75mm} -\begin{pspicture}(-6,-5)(6,5) -\rput(0,5.25){\textsf{Bouasse}} -\psmoire[type=Bouasse,rotate=10,Rmax=5] -\psmoire[type=Bouasse,rotate=170,Rmax=5] -%\psline[linecolor=red,linewidth=0.25mm](0,-6)(0,6) +\textbf{Example 3: Radial} + +\begin{minipage}[t]{9cm}\kern0pt +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=green, +linecolor=green, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{0}(0,0){\psset{xunit=1.05,yunit=1.05}\myPattern} \end{pspicture} - -\end{center} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt {\small\begin{verbatim} -\begin{pspicture}(-6,-6)(6,6) -\psmoire[type=Bouasse,rotate=10] -\psmoire[type=Bouasse,rotate=170] +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=green, +linecolor=green, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\myPattern} +\rput{0}(0,0){% +\psset{xunit=1.05,yunit=1.05} +\myPattern +} \end{pspicture} \end{verbatim}} -% -\begin{center} -\psset{linewidth=1mm} -\begin{pspicture}(-6,-4)(6,4) -\rput(0,4.25){\textsf{Concentric circles}} -\psmoire[Rmax=4,type=circle](-0.5,0) -\psmoire[Rmax=4,type=circle](0.5,0) -\end{pspicture} +\end{minipage} -\end{center} +\bigskip + +\textbf{Example 4: Hyperbolic} + +\begin{minipage}[t]{9cm}\kern0pt +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=brown, +linecolor=brown, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){\psset{xunit=0.95,yunit=1.05}\myPattern} +\rput{0}(0,0){\myPattern} +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{7.5cm}\kern0pt {\small\begin{verbatim} -\begin{pspicture}(-5,-5)(5,5) -\psmoire[Rmax=5,type=circle](-0.2,0) -\psmoire[Rmax=5,type=circle](0.2,0) +\begin{pspicture}(-4.5,-4.5)(4.5,4.5) +\def\myWidth{1pt} +\def\myPattern{% +\psRandom[% +randInit=42, +dotstyle=o, +fillstyle=solid, +fillcolor=brwon, +linecolor=brown, +randomPoints=4200, +dotsize=\myWidth +](-4,-4)(4,4){\psframe(-4,-4)(4,4)} +} +\rput{0}(0,0){% +\psset{xunit=0.95,yunit=1.05} +\myPattern +} +\rput{0}(0,0){\myPattern} \end{pspicture} \end{verbatim}} +\end{minipage} + +\bigskip + +\textbf{Remark:} For some more explanations of the so-called \emph{Glass patterns}, see: +\begin{center} +\url{http://www.scholarpedia.org/article/Glass_patterns} +\end{center} \newpage -% -\begin{center} -\psset{linewidth=0.5mm,Rmax=4} -\begin{pspicture}(-5,-5)(5,5) -\rput(0,4.5){\textsf{Gauss}} -\psmoire[type=Gauss,rotate=-5,linecolor=red] -\psmoire[type=Gauss,rotate=5] -\end{pspicture} -\end{center} -{\small\begin{verbatim} -\begin{pspicture}(-5,-5)(5,5) -\psmoire[type=Gauss,rotate=-10] -\psmoire[type=Gauss] -\end{pspicture} -\end{verbatim}} -% +\subsection{The command \Lcs{psRandomDot}} + +Emin Gabrielyan presents on \begin{center} -\psset{linewidth=1mm,scale=0.6} -\begin{pspicture}(-4,-4)(4,4) -\rput(0,4){\textsf{Squares}} -\psmoire[type=square,rotate=-5] -\psmoire[type=square,rotate=5] -\end{pspicture} +\url{https://docs.switzernet.com/people/emin-gabrielyan/070212-random-moire/} \end{center} -{\small\begin{verbatim} -\psmoire[type=square,rotate=-5] -\psmoire[type=square,rotate=5] -\end{verbatim}} -% +another amazing moiré pattern (his second example). + +A plate perforated with holes (the \emph{revealing layer}), is placed on top of a fixed layer (the \emph{base layer}) filled with the digit ``2'', and then rotated. + +These holes of the revealing layer are arranged randomly, and the digits ``2'' are arranged on the base layer at exactly the same places (just larger than the holes and rotated by -90 degrees). Both layers are therefore correlated---this is the necessary condition for the existence of this random moiré phenomenon. + +Why do we see the digit ``2'' as a \emph{halo} with a magnifying effect as a function of the angle---upright or upside down according to the sign of the angle? The holes of the revealing layer cover the digits ``2'' of the base layer and these superposed parts reconstruct an enlarged digit ``2''; what is the explanation of this phenomenon? + + +\bigskip + +\begin{BDef} +\Lcs{psRandomDot}\OptArgs\Largr{x , y} +\end{BDef} + +The command \Lcs{psRandomDot} contains the options \nxLkeyword{hole=}, \nxLkeyword{r=}, \nxLkeyword{p=}, \nxLkeyword{k=}, \nxLkeyword{symbole=}, \nxLkeyword{rotate=}, \nxLkeyword{PSfont=}, \nxLkeyword{fontsize=}, \nxLkeyword{vadjust=} and \nxLkeyword{hadjust=}. + +The optional argument \Largr{x , y} sets up the dimensions \texttt{x} and \texttt{y} of the image. If not chosen $(10,10)$ is taken by default. + +\medskip + +\begin{quote} +\begin{tabularx}{\linewidth}{ @{} l >{\ttfamily}l X @{} }\toprule +\textbf{Name} & \textbf{Default} & \textbf{Meaning}\\\midrule +\Lkeyword{hole} & round & Types of holes: hole=round (circle holes), hole=square (square holes)\\ +%% +\Lkeyword{r} & 0.5 & Radius for circle/side length of square of the holes (in pt)\\ +%% +\Lkeyword{p} & 4 & Distance between the holes (in pt).\\ +%% +\Lkeyword{rotate} & 0 & Angle of rotation between base layer and revealing layer (in degrees) \\ +& & Typical values: -2{\ttfamily}l X @{} }\toprule +\textbf{Name} & \textbf{Default} & \textbf{Meaning}\\\midrule +\Lkeyword{function} & 5 r mul t 5 mul sin neg & The equation of the function\\ + & 0.5 mul 1 add mul 2.5 sub & \\ + && \texttt{r} and \texttt{t} are the variables of the function in polar coordinates\\ + && \verb-r=sqrt(x^2+y^2)-, \verb+t=theta+\\ +%% +\Lkeyword{layer} & true & Both layers are shown. If set to \texttt{false}, only the layer with the hidden shape of the function is shown.\\ +\bottomrule +\end{tabularx} +\end{quote} + +\textbf{Note:} The dimensions of the layers are 15 cm x 15 cm and can be modified with \texttt{unit=}. + +\bigskip + +\textbf{Remarks:} +\begin{itemize} +\item The key \texttt{function=} is the equation of a function in polar coordinates with the variables \texttt{r} (radius coordinate) and \texttt{t}, which is an angle in degrees. + + The star-like functions are of the type: \texttt{z=r*(1-0.5*cos(theta))}, with each value of \texttt{z} there corresponds a star-like function with the equation (in polar coordinates): + + \texttt{r=z/(1-0.5*cos(theta))} + + The equation of a function can either be entered with RVN (Reverse Polish Notation = PostScript notation) or when the PSTricks key \texttt{algebraic=true} is set, it is possible to enter the equation in algebraic notation (therefore we need to transform the variable \texttt{t} from degrees into radians which can be done with the substitution \texttt{t -> t*Pi/180}. +\item If the key \texttt{layer=false} is set to false, only the layer with the hidden shape of the function is shown. +\item The colors of the randomly arranged dots can be chosen with the PSTricks keys \texttt{linecolor=} (for the first layer) and \texttt{fillcolor=} (for the second layer). +\item The size and shape of the dots can be setup with the PSTricks keys \texttt{dotsize=} and \texttt{dotstyle=}. +\end{itemize} \newpage +\textbf{Example 1:} + +Here a citation from Isaac Amidror from his book: + +``The Theory of the Moiré Phenomenum'', Volume II: Aperiodic Layers, \textbf{3-18: Synthesis of a layer superposition having a predefined fixed locus.} + +\begin{quote}\itshape +``Design layer transformations $\mathbf{g}_1(x,y)$ and $\mathbf{g}_2(x,y)$ that will produce in the superposition of two initially identical random screens a fixed locus consisting of a star-like curve that surrounds the origin as shown in the figure on the front cover of this book. Hint: In this case, you may consider a top-opened conic surface having star-like level lines, such as $z=r(1+0.5\cos5\theta)$, or, possibly, $z=r/(1+0.5\cos5\theta)$, which gives a slightly different star. You may adjust the orientation of the star by replacing $\cos$ by $\sin$ or by $-\sin$, as seems suitable. In order to have this surface intersect the $x,y$ plane along a star, you need to lower it by some constant $z_0$: $z=r(1+0.5\cos5\theta)-z_0$. But if you wish to obtain a more complex surface that intersects the $x,y$ plane on a family of concentric stars, you may consider a surface such as: $z=\sin(r(1+0.5\cos5\theta))$.'' +\end{quote} + \begin{center} -\psset{Rmax=4,dotstyle=square*,dotsize=0.25cm,linecolor={[cmyk]{0 0.81 1 0.6}}} -\begin{pspicture}(-4,-4)(4,5) -\rput(0,4.5){\textsf{Chess pattern}} -\psmoire[type=chess,rotate=-5] -\psmoire[type=chess,rotate=5] +\begin{pspicture}(-7,-7)(7,7) +\psframe*[linecolor=orange](-7,-7)(7,7) +% z=5*r*(1-0.5*sin(5*t*Pi/180))-2.5 +\psGlassPattern[unit=0.8,linecolor=red] \end{pspicture} \end{center} {\small\begin{verbatim} -\psset{Rmax=4,dotstyle=square*,dotsize=0.25cm} -\begin{pspicture}(-4,-4)(4,5) -\psmoire[type=chess,rotate=-5] -\psmoire[type=chess,rotate=5] +\begin{pspicture}(-7,-7)(7,7) +\psframe*[linecolor=orange](-7,-7)(7,7) +% z=5*r*(1-0.5*sin(5*t*Pi/180))-2.5 +\psGlassPattern[unit=0.8,linecolor=red] \end{pspicture} \end{verbatim}} -% -\begin{center} -\psset{Rmax=8,linewidth=0.5mm,scale=0.5,linecolor={[rgb]{0.15 0.55 0.15}}} -\begin{pspicture}(-5,-4)(5,5) -\rput(0,4.75){\textsf{Bands of Fresnel + lines}} -\psmoire[type=Fresnel] -\psmoire[type=linear] -\psmoire[type=linear](-0.1,0) -% et, \'{e}ventuellement, pour avoir le trait vertical qui manque \`{a} droite -%\psmoire[type=linear,linewidth=0.2mm](0.1,0) + + +\newpage + + +\textbf{Example 2:} + +\begin{minipage}[t]{11cm}\kern0pt +\begin{pspicture}(-5,-5)(5,5) +\psframe*[linecolor=red](-5,-5)(5,5) +% in algebraic notation +% t in degrees; +% arguments of sin and cos in radians +% convert t -> t*Pi/180 +\psGlassPattern[% +unit=0.65, +dotsize=1pt, +dotstyle=square, +linecolor={[rgb]{0 0 0.5}}, +algebraic, +function=5*r*(1-0.5*cos(7*t*Pi/180))-2.5] \end{pspicture} -\end{center} -{\small\begin{verbatim} -\begin{pspicture}(-4,-4)(4,4) -\psmoire[type=Fresnel] -\psmoire[type=linear] -\psmoire[type=linear](-0.1,0) +\end{minipage} +\hfill +\begin{minipage}[t]{6cm}\kern0pt +{\footnotesize\begin{verbatim} +\begin{pspicture}(-5,-5)(5,5) +\psframe*[linecolor=red](-5,-5)(5,5) +% in algebraic notation +% t in degrees; +% arguments of sin and cos in radians +% convert t -> t*Pi/180 +\psGlassPattern[% +unit=0.65, +dotsize=1pt, +dotstyle=square, +linecolor={[rgb]{0 0 0.5}}, +algebraic, +function=5*r*(1-0.5*cos(7*t*Pi/180))-2.5] \end{pspicture} \end{verbatim}} +\end{minipage} +\medskip -\newpage +\textbf{Example 3:} -These rotating moirés were obtained with the use of the \texttt{pst-lens} package. It is the reproduction, with the tools of PSTricks, of the photograph 6, page 137 of the book ``\textit{Les phénomènes naturels}'' of the Library \textbf{Pour la Science}, Berlin (1978). This photograph is accompanied by the following comment: -\begin{quote}\itshape -<<~Ces moirés tournants apparaissent quand les lentilles placées sur une trame et observées avec une autre trame identique à la première. La grosse lentille(convergente) réduit la trame inférieure, tandis que la petite lentille (divergente) la grossit. En conséquence, les moirés obtenus ont des sens de rotation opposés. Une figure de moiré ondulée traduit la présence d'aberrations optiques dans la lentille.~>> -\end{quote} -\textbf{Animation:} Big lens: magnification of 1.2, small lens: magnification of 0.8 -\begin{center} -\psset{unit=0.5} -\begin{animateinline}[controls,palindrome, - begin={\begin{pspicture}(-8.5,-8.5)(8.5,8.5)}, - end={\end{pspicture}}]{10}% 10 image/s -\multiframe{20}{i=-10+1}{% -\psset{LensHandle=false,LensShadow=false} -\psset{linecolor=red,linewidth=0.1,type=linear} -\psmoire% -\PstLens[LensMagnification=1.2,LensSize=2](1,1.5){\psmoire} -\PstLens[LensMagnification=0.8,LensSize=1.5](-2,-2){\psmoire} -\psmoire[linecolor=black,rotate=\i]} -\end{animateinline} -\end{center} -{\tiny\begin{verbatim} -\psset{unit=0.5} -\begin{animateinline}[controls,palindrome, - begin={\begin{pspicture}(-8.5,-8.5)(8.5,8.5)}, - end={\end{pspicture}}]{10}% 10 image/s -\multiframe{20}{i=-10+1}{% -\psset{LensHandle=false,LensShadow=false} -\psset{linecolor=red,linewidth=0.1,type=linear} -\psmoire% -\PstLens[LensMagnification=1.2,LensSize=2](1,1.5){\psmoire} -\PstLens[LensMagnification=0.8,LensSize=1.5](-2,-2){\psmoire} -\psmoire[linecolor=black,rotate=\i]} -\end{animateinline} +\begin{minipage}[t]{11cm}\kern0pt +\begin{pspicture}(-5,-5)(5,5) +\psframe*[linecolor=cyan](-5,-5)(5,5) +% in algebraic notation +% t in degrees; +% arguments of sin and cos in radians +% convert t -> t*Pi/180 +\psGlassPattern[% +unit=0.65, +dotsize=1pt, +dotstyle=square*, +linecolor=black, +fillcolor=cyan, +algebraic, +function=5*r/(1-0.75*sin(5*t*Pi/180))-2.5] +\end{pspicture} +\end{minipage} +\hfill +\begin{minipage}[t]{6cm}\kern0pt +{\footnotesize\begin{verbatim} +\begin{pspicture}(-5,-5)(5,5) +\psframe*[linecolor=cyan](-5,-5)(5,5) +% in algebraic notation +% t in degrees; +% arguments of sin and cos in radians +% convert t -> t*Pi/180 +\psGlassPattern[% +unit=0.65, +dotsize=1pt, +dotstyle=square*, +linecolor=black, +fillcolor=cyan, +algebraic, +function=5*r/(1-0.75*sin(5*t*Pi/180))-2.5] +\end{pspicture} \end{verbatim}} +\end{minipage} \newpage @@ -577,6 +1727,11 @@ Some interactive moiré JavaScript based applications can be found on: \url{https://melusine.eu.org/syracuse/G/pstricks/pst-moire/moirej/} \end{center} +The following animations are all generated with the \texttt{animate} package of Alexander Grahn. +\begin{center} +\url{https://ctan.org/pkg/animate} +\end{center} + \textbf{Animation 1:} \begin{center} @@ -617,8 +1772,10 @@ Some interactive moiré JavaScript based applications can be found on: end={\end{pspicture}} ]{10}% 10 image/s \multiframe{36}{r=0+0.1}{% -\psmoire[scale=0.85,type=linear,rotate=-\r,linewidth=0.1,linecolor=red](0,0)% -\psmoire[scale=0.85,type=linear,rotate=\r,linewidth=0.1,linecolor=red](0,0)% +\psframe*[linecolor=black](-6,-6)(6,6) +\psmoire[type=linear,rotate=-\r,linewidth=0.05,linecolor=yellow,n=60](0,0)% +\psmoire[type=linear,rotate=\r,linewidth=0.15,linecolor=black,n=60](0,0)% +\psframe[linecolor=yellow,linewidth=5pt](-6,-6)(6,6) } \end{animateinline} \end{center} @@ -629,8 +1786,10 @@ Some interactive moiré JavaScript based applications can be found on: end={\end{pspicture}} ]{10}% 10 image/s \multiframe{36}{r=0+0.1}{% -\psmoire[scale=0.85,type=linear,rotate=-\r,linewidth=0.1,linecolor=red](0,0)% -\psmoire[scale=0.85,type=linear,rotate=\r,linewidth=0.1,linecolor=red](0,0)% +\psframe*[linecolor=black](-6,-6)(6,6) +\psmoire[type=linear,rotate=-\r,linewidth=0.05,linecolor=yellow,n=60](0,0)% +\psmoire[type=linear,rotate=\r,linewidth=0.15,linecolor=black,n=60](0,0)% +\psframe[linecolor=yellow,linewidth=5pt](-6,-6)(6,6) } \end{animateinline} \end{verbatim} @@ -657,6 +1816,10 @@ Some interactive moiré JavaScript based applications can be found on: \end{animateinline} \end{center} {\small\begin{verbatim} +\definecolor{moire1}{rgb}{0.98,0.89,0.56} +\definecolor{moire2}{rgb}{0.357,0.525,0.13} +\definecolor{moire3}{rgb}{0.2,0.05,0.015} +\definecolor{moire4}{rgb}{0.070.41 0.255} \begin{animateinline}[% controls,palindrome, begin={\begin{pspicture}(-6,-6)(6,6)}, @@ -713,7 +1876,7 @@ Some interactive moiré JavaScript based applications can be found on: \textbf{Animation 5:} -This idea came from a post card ``\textbf{turn the top part}'', bought in a boutique of the centre Beaubourg in Paris, showing the phenomenon of the moiré effect and redesigned with PSTricks. +The reason to finally setup this PSTricks package came from a post card ``\textit{turn the top part}''---bought years ago in a boutique of the \emph{Centre Beaubourg} in Paris---showing up this quite spectacular phenomenon of the \emph{moiré effect} and the following code was quickly ready made to redesign it within PSTricks. \begin{center} \def\myMoire{% @@ -813,9 +1976,9 @@ This idea came from a post card ``\textbf{turn the top part}'', bought in a bout \section{Theory---for the interested user}\label{sec:theory} -\subsection{The contribution of ``éditions Kangourou''} +\subsection{The contribution of ``\textit{éditions Kangourou}''} -``Le Kangourou des mathématiques'': \textcolor{orange}{\url{http://www.mathkang.org/}} published a revue in 2002, ``\textsl{Les malices du Kangourou}'' that contains a magnificent article from pages 18 to 26 titled ``\textsl{Mirifiques et mirobolants moirés}'' and on the back cover ``La règle à moirer'' (``The ruler''). The article and the ruler are available at the following addresses: +``\textit{Le Kangourou des mathématiques}'': \textcolor{orange}{\url{http://www.mathkang.org/}} published a revue in 2002, ``\textit{Les malices du Kangourou}'' that contains a magnificent article from pages 18 to 26 titled ``\textit{Mirifiques et mirobolants moirés}'' and on the back cover ``\textit{La règle à moirer}'' (``\textit{The ruler}''). The article and the ruler are available at the following addresses: \begin{center} \url{http://www.mathkang.org/cite/moires9p.pdf} \\ @@ -836,13 +1999,13 @@ In the article the sketches are very beautiful and the part ``\textit{Mathémati \newpage -\subsection{The contribution of Henri Bouasse} +\subsection{The contribution of Henri Bouasse}\label{sec:Bouasse} \newcounter{boua} \newcommand{\itemBoua}{\addtocounter{boua}{1}\strut\indent\textit{\theboua}\textsuperscript{o} --- } -This is the chapter of his book \textit{Vision et reproduction des formes et des couleurs} published at Librairie Delagrave in Paris in 1917. His demonstration and the diagram within his book have been reproduced here: +This is the chapter of his book ``\textit{Vision et reproduction des formes et des couleurs}'' published at Librairie Delagrave in Paris in 1917. His demonstration and the diagram within his book have been reproduced here: \medskip @@ -855,7 +2018,7 @@ This is the chapter of his book \textit{Vision et reproduction des formes et des Consider two straight lines respectively parallel: \begin{equation} x\cos\THETA +y\sin\THETA=bt+ct^2\quad\quad x\cos\THETA -y\sin\THETA=b\TAU-c\TAU^2 -\label{droites} +\label{eq:droites} \end{equation} \begin{figure}[h] \begin{center} @@ -914,7 +2077,7 @@ x\cos\THETA +y\sin\THETA=bt+ct^2\quad\quad x\cos\THETA -y\sin\THETA=b\TAU-c\TAU^ } \end{pspicture} \end{center} -\caption{\label{fig169} Moiré: parallel lines} +\caption{Moiré: parallel lines} \end{figure} \indent For $t=\TAU=0$, we get the two lines $\mathrm{OS_2}$ and $\mathrm{OS_1}$; they obviously have the same angle $\THETA$ with the axis $\mathrm{O}y$. @@ -922,7 +2085,7 @@ The curves of the intersection points, which correspond to the small diagonals o \begin{equation*} t-\TAU=\MU=\mathrm{constant} \end{equation*} -\indent Adding and reordering the equations~(\ref{fig169}): +\indent Adding and reordering the equations~(\ref{eq:droites}): \begin{align*} 2x\cos\THETA&=(b+c\MU)(t+\TAU)\\ 2y\sin\THETA&=b\MU+c(t^2+\TAU^2)=b\MU+c(\MU^2+2t\TAU) @@ -953,23 +2116,23 @@ The equation~(\ref{parabole}) becomes: \indent This is the same parabola for all the values of $\MU$ sliding parallely to O$y$. The vertices are given by: \begin{equation} y=\MU \frac{b}{2\sin\THETA} -\label{sommets2} +\label{eq:sommets2} \end{equation} The radius of curvature at the vertex of the parabola is: \begin{equation*} \mathrm{R}=\frac{b^2}{2c}\frac{\sin\THETA}{\cos^2\THETA} \end{equation*} -\indent If the parallel straight lines are equidistant $(c=0)$, the parabolas degenerate to straight lines~(\ref{sommets2}); in other words, the radius of curvature becomes infinite. +\indent If the parallel straight lines are equidistant $(c=0)$, the parabolas degenerate to straight lines~(\ref{eq:sommets2}); in other words, the radius of curvature becomes infinite. \\ -\itemBoua To make an experiment, we trace with ``China ink'' on a paper 51 parallel lines with a length of i. e. 20~cm, where the distance between two adjacent lines increases from 2~mm (between the first two lines) to 3~mm (between the last two lines), following the formula: +\itemBoua To make an experiment, we trace with ``\textit{China ink}'' on a paper 51 parallel lines with a length of i. e. 20~cm, where the distance between two adjacent lines increases from 2~mm (between the first two lines) to 3~mm (between the last two lines), following the formula: \begin{equation*} s=2t+0.01t^2 \end{equation*} \indent We take a photo by reducing to the half or a quarter. We generate two diapositives\footnote{spelling of the time.}. We realize the phenomenon when placing one over the other by rotating one of them. -We think that if you had followed the given instructions, you might be as well convinced---as we are---it would have been a pity to have left this beautiful demonstration ``of that time'' in oblivion! +We think that if you had followed the given instructions, you might be as well convinced---as we are---it would have been a pity to have left this beautiful demonstration ``\textit{of that time}'' in oblivion! \subsection{The humble contributions of our group} @@ -999,7 +2162,7 @@ This method is discussed on page 136 of the book ``\textit{Les phénomènes natu y=a\mathrm{e}^{-(kx)^2} \end{equation*} \begin{center} -\begin{pspicture}(-6,-1)(6,3.5) +\begin{pspicture}(-6,-0.5)(6,3.5) \psparametricplot[plotpoints=1000]{-6}{6}{% t 3 2.71828 -0.5 t dup mul mul exp mul @@ -1008,13 +2171,13 @@ y=a\mathrm{e}^{-(kx)^2} \end{center} -\subsubsection{Determination of the points of intersection} +\subsubsection{Determination of the points of intersection}\label{sec:Gauss} -The equidistant vertical line network has for equation: $x=ne$, $e$ is the spacing et $n$ an integer. +The equidistant vertical line network has for equation: $x=ne$, $e$ is the spacing and $n$ is an integer. -The ordinates of the intersection points are: $y_n=a\mathrm{e}^{-(kne)^2}$. Within the following figure, we set the spacing to 0.5. +The ordinates of the intersection points are: $y_n=a\mathrm{e}^{-(kne)^2}$. Within the following figure, we set the spacing between the points on the Gaussian curve with the key \texttt{E=0.5} (in cm). \begin{center} -\begin{pspicture}(-6,-1)(6,3.5) +\begin{pspicture}(-6,-0.5)(6,3.5) \parametricplot[plotpoints=1000]{-6}{6}{% t 3 2.71828 0.5 t mul dup mul neg exp mul @@ -1030,13 +2193,19 @@ The ordinates of the intersection points are: $y_n=a\mathrm{e}^{-(kne)^2}$. With \psdot(! \n\space E1 mul % x A1 2.71828 K1 \n\space E1 mul mul dup mul neg exp mul) } +\psline[linecolor=red]{|<->|}(! -11 E1 mul 0.5)(! -10 E1 mul 0.5) +\uput[90](! -10.5 E1 mul 0.5){\textcolor{red}{\texttt{E=0.5}}} +\psline[linecolor=red]{|<->|}(! -5 E1 mul 1.5)(! -4 E1 mul 1.5) +\uput[90](! -4.5 E1 mul 1.5){\textcolor{red}{\texttt{E=0.5}}} +\psline[linecolor=red]{|<->|}(! 5 E1 mul 1)(! 6 E1 mul 1) +\uput[90](! 5.5 E1 mul 1){\textcolor{red}{\texttt{E=0.5}}} \end{pspicture} \end{center} -\subsubsection{Drawing the network of the stright lines} +\subsubsection{Drawing the network of the straight lines} -We determine the equations of the straight lines passing through these points and which are inclined by an angle $\alpha$ with respect to the horizontal. +We determine the equations of the straight lines passing through these points and which are inclined by an angle $\alpha$ with respect to the horizontal. This is to setup with the key \texttt{Alpha=} (in degrees). The general equation of such a line is given by: $y=x\tan(\alpha)+b$, we determine $b$ to go through one of the previous points. \begin{equation*} @@ -1046,6 +2215,11 @@ so we get $b$. \begin{equation*} b=a\mathrm{e}^{-(kne)^2}-ne\tan(\alpha) \end{equation*} + + +\newpage + + For every value of $n$ we get a straight line. \begin{equation*} y=x\tan(\alpha)+a\mathrm{e}^{-(kne)^2}-ne\tan(\alpha) @@ -1095,7 +2269,7 @@ The last step is to translate these lines into PostScript code. \subsection{Some moiré figures} -\subsubsection{Circles + Circles} +\subsubsection{\texttt{type=circle + type=circle}} \begin{center} \psscalebox{0.6}{% @@ -1177,10 +2351,9 @@ b^2=a^2-c^2 \] -\subsubsection{Squares + Fresnel rings} +\subsubsection{\texttt{type=square + type=Fresnel}} \begin{center} -%\psset{scale=0.5,Rmax=7.5} \psscalebox{0.6}{% \begin{pspicture}(-6,-6)(6,6) \psmoire[type=square] @@ -1226,7 +2399,7 @@ On a curve of moiré, we verify: $p-q=m\in\mathbb{Z}$: This family of moiré curves are circles with the center at $(\frac{1}{2a},0)$ and with a radius of $r_m=\sqrt{m+\frac{1}{4a^2}}$ -\subsubsection{Circle + Squares of Newton} +\subsubsection{\texttt{type=circle + type=Newton}} \begin{center} %\psset{scale=0.5,Rmax=7.5} @@ -1312,8 +2485,7 @@ In polar coordinates: \end{minipage} - -\subsubsection{Circles + Fresnel rings} +\subsubsection{\texttt{type=circle + type=Fresnel}} \begin{center} %\psset{scale=0.5} @@ -1363,7 +2535,7 @@ One moiré curve line is determined by: $p-q=m\in\mathbb{Z}$, thus: which is the implicit equation of a moiré curve line with $m$. -\subsubsection{Circles + Squares (both of increasing thickness)} +\subsubsection{Circles and Squares (both of increasing thickness)} \begin{center} \psscalebox{0.6}{% @@ -1486,4 +2658,75 @@ We can trace some elements of this family of curves:\label{sec:theoryEnd} \egroup \printindex + + +\newpage + + +\begin{appendix} +\section{PostScript Font Names}\label{sec:PSF} + +\begin{minipage}[t]{0.45\linewidth}\kern0pt +\subsubsection*{Ghostscript} + +\begin{tabular}{ll} +uagd8a & URWGothicL-Demi \\ +uagdo8a & URWGothicL-DemiObli \\ +uagk8a & URWGothicL-Book \\ +uagko8a & URWGothicL-BookObli \\ +ubkd8a & URWBookmanL-DemiBold \\ +ubkdi8a & URWBookmanL-DemiBoldItal \\ +ubkl8a & URWBookmanL-Ligh \\ +ubkli8a & URWBookmanL-LighItal \\ +ucrb8a & NimbusMonL-Bold \\ +ucrbo8a & NimbusMonL-BoldObli \\ +ucrr8a & NimbusMonL-Regu \\ +ucrro8a & NimbusMonL-ReguObli \\ +uhvb8a & NimbusSanL-Bold \\ +uhvb8ac & NimbusSanL-BoldCond \\ +uhvbo8a & NimbusSanL-BoldItal \\ +uhvbo8ac & NimbusSanL-BoldCondItal \\ +uhvr8a & NimbusSanL-Regu \\ +uhvr8ac & NimbusSanL-ReguCond \\ +uhvro8a & NimbusSanL-ReguItal \\ +uhvro8ac & NimbusSanL-ReguCondItal \\ +uncb8a & CenturySchL-Bold \\ +uncbi8a & CenturySchL-BoldItal \\ +uncr8a & CenturySchL-Roma \\ +uncri8a & CenturySchL-Ital \\ +uplb8a & URWPalladioL-Bold \\ +uplbi8a & URWPalladioL-BoldItal \\ +uplr8a & URWPalladioL-Roma \\ +uplri8a & URWPalladioL-Ital \\ +usyr & StandardSymL \\ +utmb8a & NimbusRomNo9L-Medi \\ +utmbi8a & NimbusRomNo9L-MediItal \\ +utmr8a & NimbusRomNo9L-Regu \\ +utmri8a & NimbusRomNo9L-ReguItal \\ +uzcmi8a & URWChanceryL-MediItal \\ +uzdr & Dingbats +\end{tabular} +\end{minipage} +\hfill +\begin{minipage}[t]{0.45\linewidth}\kern0pt +\subsubsection*{Adobe Basic 14} + +\begin{tabular}{ll} +Times & Times-Roman \\ + & Times-Italic \\ + & Times-Bold \\ + & Times-BoldItalic \\ +Helvetica & Helvetica \\ + & Helvetica-Oblique \\ + & Helvetica-Bold \\ + & Helvetica-BoldOblique \\ +Courier & Courier \\ + & Courier-Oblique \\ + & Courier-Bold \\ + & Courier-BoldOblique \\ +ZapfDingbats & ZapfDingbats \\ +Symbol & Symbol +\end{tabular} +\end{minipage} +\end{appendix} \end{document} \ No newline at end of file diff --git a/Master/texmf-dist/doc/generic/pst-moire/pst-sin.pro b/Master/texmf-dist/doc/generic/pst-moire/pst-sin.pro new file mode 100644 index 00000000000..f3f9e82302b --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-moire/pst-sin.pro @@ -0,0 +1,26 @@ +moireDict begin +/pst-sin { +0 0 translate +2 dict begin +/A1 0.5 def % amplitude +/TRAME { +-50 E1 2 mul 50 {/n exch def +gsave + n E1 mul unit % x + A1 unit 360 Tr div n E1 mul mul sin mul % y + translate + linecolor + linewidth + -6 unit -6 m mul unit moveto + 6 unit 6 m mul unit lineto + stroke +grestore + } for +} def +Runit neg dup +Runit 2 mul dup +rectclip + TRAME +end +} def +end -- cgit v1.2.3