43

Are the tikzducks used to explain any scientific stuff?

I'm currently compiling a list of such applications for an upcoming talk, so even if you are not able to share your image, it would be helpful to hear examples of topics the tikzducks are used for.

Please note, that no ducks may be harmed in your answers

13 Answers13

32

It is possible to form a grammatical English sentence of length n, using only the words "duck" and "ducks", for all values of n.

Using tikzducks perhaps makes the visualization of the structures easier.

\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\usepackage{tikzducks}
\usepackage[linguistics]{forest}
\usepackage{multicol}
\newcommand{\Ducks}{\begin{tikzpicture}[scale=.2]\duck\begin{scope}[xshift=1.5cm]\duck\end{scope}\end{tikzpicture}}
\let\ducks\Ducks
\usepackage{gb4e}
\begin{document}
\begin{theorem}
For any $n$, there is a grammatical English sentence of length $n$ consisting only of some combination of the words \emph{duck} and \emph{ducks}.  
\end{theorem}
Here are the first $6$ (with very simplified trees).
\begin{multicols}{2}
\begin{exe}
\ex Duck!
\ex Ducks duck.
\ex Ducks duck ducks.
\ex Ducks ducks duck duck.
\ex Ducks ducks duck duck ducks.
\ex Ducks ducks ducks duck duck duck.
\end{exe}
\columnbreak\setcounter{exx}{0}
\begin{exe}
\ex Duck!
\ex \Ducks{} duck.
\ex \Ducks{} duck \ducks.
\ex \Ducks{} \ducks{} duck duck.
\ex \Ducks{} \ducks{} duck duck \ducks.
\ex \Ducks{} \ducks{} \ducks{} duck duck duck.
\end{exe}
\end{multicols}
\setcounter{exx}{0}
\begin{multicols}{2}
\begin{exe}
\ex\begin{forest}
[S [NP\\pro ] [VP [V\\duck ]]]
\end{forest}
\ex\begin{forest}
[S [NP\\\Ducks ] [VP [V\\duck]]]
\end{forest}
\ex\begin{forest}
[S [NP\\\Ducks ] [VP [V\\duck ] [NP\\\ducks ]]]
\end{forest}
\ex\begin{forest}
[S [NP [NP\\\Ducks ][S [NP\\\Ducks ] [VP [V\\duck]]]] [VP [V\\duck]]]
\end{forest}
\ex
\begin{forest}
[S [NP [NP\\\Ducks ][S [NP\\\Ducks ] [VP [V\\duck]]]] [VP [V\\duck ] [NP\\\ducks ]]]
\end{forest}
\ex
\begin{forest}
[S [NP [NP\\\Ducks ][S [NP [NP\\\Ducks ][S [NP\\\Ducks ] [VP [V\\duck]]]] [VP [V\\duck]]]][VP [V\\duck]]]
\end{forest}
\end{exe}
\end{multicols}
\end{document}

output of code

Alan Munn
  • 218,180
30

Using the wake of a duck to explain the opening angle of Cherenkov light

(See https://physics.stackexchange.com/a/9483 for more details about this analogy)

\documentclass{standalone}
\usepackage{tikzducks}

\begin{document}

\begin{tikzpicture} \begin{scope}[scale=0.5,xshift=-23,yshift=320] \duck \end{scope}
\draw[black] (10,6) circle (4.45) (9,6) circle (4)
(8,6) circle (3.55) (7,6) circle (3.1)
(6,6) circle (2.68) (5,6) circle (2.24)
(4,6) circle (1.8) (3,6) circle (1.35)
(2,6) circle (0.9)
(1,6) circle (0.47)
; \draw[blue,thick] (12,0) -- (0,6) -- (12,12) (0,6) -- (15,6) (8.15,1.96) -- (10,6) -- (8.15,10.04) (8.8,6)arc(180:120:1.345551) ; \draw[thick,rotate=26.5,blue,->] (4,5.35) -- ++(0,0.8); \draw[thick,rotate=26.5,blue,->] (6,5.35) -- ++(0,0.8); \draw[thick,rotate=26.5,blue,->] (8,5.35) -- ++(0,0.8); \draw[thick,rotate=26.5,blue,->] (10,5.35) -- ++(0,0.8); \draw[thick,rotate=26.5,blue,->] (12,5.35) -- ++(0,0.8); \draw[thick,rotate=26.5,blue,->] (14,5.35) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (-1.4,4.55) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (0.6,4.55) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (2.6,4.55) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (4.6,4.55) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (6.6,4.55) -- ++(0,0.8); \draw[thick,rotate=-26.5,blue,<-] (8.6,4.55) -- ++(0,0.8);
\node at (9.35,6.4) {\Large $\Theta_{c}$}; \end{tikzpicture}

\end{document}

enter image description here


Improved 3D version by @marmot

from https://chat.stackexchange.com/transcript/message/43703817#43703817

\documentclass{standalone}
\usepackage{tikzducks}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{0}{0}
\begin{tikzpicture}
\begin{scope}[scale=0.5,xshift=-20,yshift=-20]
\duck
\end{scope}
\tdplotsetrotatedcoords{-30}{40}{45}
\begin{scope}[tdplot_rotated_coords]
\foreach \X in {1,...,10}
{
\draw[black] (0,0,\X) circle ({\X*0.45});
\draw[thick,blue,->] (0,{\X*0.45},\X) -- ++(0,0.32,{-0.3*0.45});
\draw[thick,blue,->] (0,{-\X*0.45},\X) -- ++(0,-0.32,{-0.3*0.45});
}
\draw[blue,thick]
(0,4.5,10) -- (0,0,0) -- (0,-4.5,10)
(0,0,0) -- (0,0,14.5) coordinate (P)
(0,4.5,10) -- (0,0,14.5) -- (0,-4.5,10);
\coordinate (M) at (0,0,10);
\end{scope}
\tdplotsetrotatedcoords{-120}{150}{0}
\begin{scope}[tdplot_rotated_coords,red]
\draw (M) arc (-90:-57:3) node[midway,right,yshift=-5]{\Large $\Theta_{c}$};
\end{scope}
\end{tikzpicture}
\end{document}

enter image description here

30

enter image description here

\documentclass{article}
\usepackage{tikzducks}
\begin{document}
\section*{Length contraction}
\begin{tabular}{ccc}
 $v=0$ & $v=0.5\cdot c$ & $v=0.9\cdot c$\\
 \begin{tikzpicture}
 \path[use as bounding box](0,0) rectangle (2.4,2.4);
 \duck
 \end{tikzpicture}
 &
 \begin{tikzpicture}
 \path[use as bounding box](-0.25,0) rectangle (2.15,2.4);
 \pgftransformcm{sqrt(1-0.5^2)}{0}{0}{1}{\pgfpoint{0cm}{0cm}} 
 \duck
 \end{tikzpicture}
 &
 \begin{tikzpicture}
 \path[use as bounding box](-0.5,0) rectangle (1.9,2.4);
 \pgftransformcm{sqrt(1-0.9^2)}{0}{0}{1}{\pgfpoint{0cm}{0cm}} 
 \duck
 \end{tikzpicture}
\end{tabular}\\
Don't worry, the ducks are fine!
\end{document}

Just for fun: rocket ducks.

\documentclass{article}
\addtolength{\textwidth}{2cm}
\usepackage{tikzducks}
\usetikzlibrary{shadings,fadings}
\newcommand{\RocketDuck}{ \duck
 \shade[ball color=blue,opacity=0.15] (1,1) circle (1.3);
 \fill [color=orange,path fading=east] (3.9,-0.75) 
 -- ++({3*cos(25)},{3*sin(25)}) arc (25:-25:3) 
 -- ++ ({-3*cos(25)},{3*sin(25)}) -- cycle;
 \shade[bottom color=red,top color=red!25!white] (4,0.25) arc (90:-90:0.25 and 1) -- (-2,-1.75) 
 arc (-90:90:0.25 and 1) -- cycle;
 \shade[bottom color=blue,top color=blue!25!white] (-2,-1.75) arc (-90:90:0.25 and 1) 
 -- (-3.2,-0.75) -- cycle;
}
\begin{document}
\section*{Length contraction (Don't worry, the ducks are fine!)}
 \begin{tikzpicture}
 \draw[ultra thick,-latex] (-1,1.8) -- (-3,1.8) node[midway,above]{$v=0$};
 \RocketDuck
 \begin{scope}[yshift=-5cm]
 \draw[ultra thick,-latex] (-1,1.8) -- (-3,1.8) node[pos=0.45,above]{$v=0.5\cdot c$};
 \pgftransformcm{sqrt(1-0.5^2)}{0}{0}{1}{\pgfpoint{0cm}{0cm}} 
 \RocketDuck
 \end{scope}
 \begin{scope}[yshift=-10cm]
 \draw[ultra thick,-latex] (-1,1.8) -- (-3,1.8) node[pos=0.45,above]{$v=0.9\cdot c$};
 \pgftransformcm{sqrt(1-0.9^2)}{0}{0}{1}{\pgfpoint{0cm}{0cm}} 
 \RocketDuck
 \end{scope}
 \end{tikzpicture}
\end{document}

enter image description here

26

Here's my math joke about the formula calculating the volume of cylinder/disk which might be easier remembered by students/pupils:

The chef duck is perfectly suited for this:

enter image description here

\documentclass[10pt]{article}

\usepackage[most]{tcolorbox}
\usepackage{amsmath}
\usepackage{tikzducks}


\begin{document}
\boldmath
\begin{tcbraster}[raster columns=2,raster rows=2,height=15cm,raster equal height]
\begin{tcolorbox}[height=0.5\linewidth,valign=center,halign=center,width=0.5\linewidth,enhanced, fontupper={\large},colback=yellow!20!white, circular arc, drop shadow]

  What is the formula for the volume of a cylinder with

  \begin{itemize}
  \item radius $z$ 
  \item[]  and
  \item height $a$
  \end{itemize}


  ?
\end{tcolorbox} 
\begin{tcolorbox}[drop shadow,colback=yellow!20!white]
\begin{tikzpicture}[scale=2.5]
\duck[chef=white!95!yellow,
rollingpin=brown!80!black, think={$ V = pi \cdot z \cdot z \cdot a$}]
\end{tikzpicture}
\end{tcolorbox}
\end{tcbraster} 
\end{document}

No ducks were harmed → they are just the pizza chefs...

26

In order to add some chemistry to this list, here is a laboratory duck helping to explain the concept of chirality.

enter image description here

\documentclass{standalone}
\usepackage{tikzducks}
\usepackage{chemfig}
\usepackage{arydshln}
\begin{document}
\colorbox{black!20!white}{
\begin{tabular}{c:c}
\begin{tikzpicture}[xscale=-1,transform shape]
    \duck[glasses=gray,tshirt=black!10!white,jacket=white]
    \path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw,clip] (-0.5,1.75) to[rounded corners=2pt]++(0,-1)to[rounded corners=2pt]++(-1,-2.5)to[rounded
corners=2pt, bend right=10pt]++(3,0) to[rounded corners=2pt]++(-1,2.5)--++(0,1)++(-0.5,0) circle [x radius=0.5, y radius=0.1];
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,fill=green!90!black](-1.6,-2) rectangle (1.6,{1cm-2cm});
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,fill=green!90!white] (0,1cm-2cm) circle [x radius=1.5cm-(1cm-0.25cm)*0.4 , y radius=0.1 cm];
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0,0) circle (5pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (-0.2,0.75) circle (3pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0.25,1.15) circle (2pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0,1.4) circle (4pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (-0.25,-0.5) circle (3pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0.25,-1) circle (5pt);
\end{tikzpicture}
&
\begin{tikzpicture}
   \duck[glasses=gray,tshirt=black!10!white,jacket=white]
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw,clip] (-0.5,1.75) to[rounded corners=2pt]++(0,-1)to[rounded corners=2pt]++(-1,-2.5)to[rounded
corners=2pt, bend right=10pt]++(3,0) to[rounded corners=2pt]++(-1,2.5)--++(0,1)++(-0.5,0) circle [x radius=0.5, y radius=0.1];
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,fill=green!90!black](-1.6,-2) rectangle (1.6,{1cm-2cm});
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,fill=green!90!white] (0,1cm-2cm) circle [x radius=1.5cm-(1cm-0.25cm)*0.4 , y radius=0.1 cm];
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0,0) circle (5pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (-0.2,0.75) circle (3pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0.25,1.15) circle (2pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0,1.4) circle (4pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (-0.25,-0.5) circle (3pt);
\path[xshift=35,yshift=20,scale=0.2,rotate=-10,draw=black,  line width=0.2pt, fill=green!70!white] (0.25,-1) circle (5pt);
\end{tikzpicture}
\\[0.25cm]
\scalebox{0.6}{\chemfig{A-[:30](-[:90]B)(<:[:-10]C)(<[:-50]D)}}
&
\scalebox{.6}{\chemfig{A-[:150](-[:90]B)(<:[:190]C)(<[:230]D)}}
\end{tabular}
}

\end{document}

PS: Thanks to appropriate personal protective equipment (safety glasses and a lab coat) no ducks were harmed during the experiments...

The code for the erlenmeyer flask is heavily inspired frome this question: tikz and \pgfdeclareshape why the text is not at the center anchor?

leandriis
  • 62,593
26

Moebius Duck's evocation

enter image description here

\documentclass[margin=1cm,tikz]{standalone}
\usepackage{luatex85,tikzducks,ifthen}
\usetikzlibrary{calc}

\begin{document}

\foreach \frame in {0,...,81} {%

\pgfmathtruncatemacro{\x}{mod(\frame,41)}

\ifthenelse{\x>64 \OR \x<4}{\def\Orient{-1}}{\def\Orient{1}}

\begin{tikzpicture}[x  = {(1cm,0cm)},
                    y  = {(45:.5cm)},
                    z  = {(0cm,1.5cm)},
                    scale=3]

\foreach \L [count=\z from -2, evaluate=\z as \y using \z/4 ] in {A,...,E} {%
    \foreach \x [count=\n from 0] in {0,9,...,360} {%
        \pgfmathsetmacro{\T}{1+0.5*\y*cos(\x/2)}
        \pgfmathsetmacro{\X}{\T*cos(\x)}
        \pgfmathsetmacro{\Y}{\T*sin(\x)}
        \pgfmathsetmacro{\Z}{0.5*\y*sin(\x/2)}
        \path (\X,\Y,\Z) coordinate (\L\n)
            ;
    }
}


    \ifthenelse{\frame=62 \OR \frame=63}{%
    \begin{scope}[x={(1cm,0cm)},
                    y={(0cm,1cm)},
                    shift={($(C\x)-(.05,.03)$)},
                    scale=.05]
    \duck
    \end{scope}}{}



\foreach \i  [evaluate=\i as \j using int(\i+1),
            evaluate=\i as \K using 80-30*cos(9*(\i-22.5))
            ] in {0,1,...,39} {%
    \ifthenelse{\frame=18 \AND \i>17 \AND \i<20}{%
    \begin{scope}[x={(1cm,0cm)},
                    y={(0cm,1cm)},
                    shift={($(C18)-(.05,.03)$)},
                    scale=.05]
    \duck
    \end{scope}}{}
    \draw[smooth,gray,fill=orange!25!white!\K!blue]
                (A\i) -- (E\i) -- (E\j) -- (A\j) -- cycle ;
    \draw[smooth,gray] (B\i) -- (B\j) (D\i) -- (D\j) ;
    \draw[smooth,thick] (C\i) -- (C\j) ;
}

    \ifthenelse{\frame<18 \OR \frame>63}{%
    \begin{scope}[x={(1cm,0cm)},
                    y={(0cm,1cm)},
                    shift={($(C\x)-(.05,.03)$)},
                    scale=.05]
    \duck
    \end{scope}}{}


\end{tikzpicture}   }

\end{document}
Tarass
  • 16,912
21

Ducks preserve the amount of movement

enter image description here

\documentclass[tikz,margin=1cm]{standalone}
\usepackage{tikzducks,luatex85,ifthen}
\usetikzlibrary{calc,backgrounds}

\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}


\newcommand{\Duck}[1]{%
\begin{scope}[scale=\scl,shift={(-1.05,-1.075)}]
\clip (.1,.1) rectangle (2.1,2.15) ;
\coordinate (dck) at (1.05,1.075) ;
\duck
\end{scope}
\begin{pgfonlayer}{background}
\draw[gray!25] (dck) -- (A#1) ;
\end{pgfonlayer}
}

\begin{document}

\def\pas{.434}
\def\scl{.22}

\foreach \x in {-9,...,9,8,7,...,-8} {%


\begin{tikzpicture}

\path[use as bounding box] (-2,0) rectangle (4,1.5) ;

\foreach \i [evaluate=\i as \j using (\i-1)*\pas] in {0,...,6} {%
\coordinate[] (A\i) at (\j,1.5) ;
\fill (A\i) circle (1pt) ;
}

\ifthenelse{\x<0}{%
    \pgfmathsetmacro{\L}{-90+60*sin(10*\x)}
    \gdef\R{-90}
    }{%
    \gdef\L{-90}
    \pgfmathsetmacro{\R}{-90+60*sin(10*\x)}
    }

\begin{scope}[shift=($(A6)+(\R:1.5)$)]
\Duck{6}
\end{scope}

\begin{scope}[shift=($(A0)+(\L:1.5)$)]
\Duck{0}
\end{scope}


\foreach \i in {1,...,5} {%
    \begin{scope}[xshift=\pas*\i cm -\pas cm]
    \Duck{\i}
    \end{scope}
}


\end{tikzpicture}}
\end{document}
Tarass
  • 16,912
16

I will admit that this was slightly inspired by this question, but here is a genuine worksheet that I used today.

Projectiles with ducks

Andrew Stacey
  • 153,724
  • 43
  • 389
  • 751
15

The Doppler Duck's affect

enter image description here

\documentclass[margin=1cm,tikz]{standalone}
\usepackage{luatex85,tikzducks,ifthen}
\usetikzlibrary{calc,decorations.markings,backgrounds}

\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}


\begin{document}

\foreach \i [count=\frame from 1] in {-12.5,...,12.5} {

\ifthenelse{\frame>14}{\def\K{blue}}{\def\K{red}}

\begin{tikzpicture}

\def\X{15}
\def\Y{2}

\filldraw[gray!50,transform canvas={xslant=2}] (-\X,-\Y) -- (\X,-\Y) -- (\X,\Y) -- (-\X,\Y) -- cycle ;


\draw[line width=5pt,
    white,
    transform canvas={xslant=2},
    dash pattern=on 20mm off 8mm] (-\X,0) -- (\X,0) ;

    \begin{pgfonlayer}{foreground}
    \begin{scope}[shift={(\i,-.9)},xscale=-1]
    \ifthenelse{\frame=14}{%
        \duck[speech={Coin !},bubblecolour=white!95!yellow]}{%
        \duck
        }
    \coordinate (LH) at (wing) ;
    \end{scope}
    \end{pgfonlayer}

    \begin{scope}[shift={(-\i,.6)}]
    \duck
    \coordinate (RH) at (wing) ;
    \end{scope}

    \path[decoration={%
    markings,% switch on markings
    mark=between positions .18 and .98 step 0.2 with {
        \draw[ultra thick,\K] (0,0)
            arc (0:15:\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) ;
        \draw[ultra thick,\K] (0,0)
            arc (0:-15:\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) ;
        }
    },
    postaction={decorate}] (LH) -- (RH) ;

\end{tikzpicture}
}
\end{document}

The redshift version :

enter image description here

\documentclass[margin=1cm,tikz]{standalone}
\usepackage{luatex85,tikzducks,ifthen}
\usetikzlibrary{calc,decorations.markings,backgrounds}

\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}


\begin{document}

\foreach \i [count=\frame from 1] in {-12.5,...,12.5} {

\pgfmathsetmacro{\Koeff}{100*cos(\i/15*90)}

\ifthenelse{\frame<14}{%
    \def\K{yellow!\Koeff!blue}}{%
    \def\K{yellow!\Koeff!red}
}

\begin{tikzpicture}

\def\X{15}
\def\Y{2}

\filldraw[gray!50,transform canvas={xslant=2}] (-\X,-\Y) -- (\X,-\Y) -- (\X,\Y) -- (-\X,\Y) -- cycle ;


\draw[line width=5pt,
    white,
    transform canvas={xslant=2},
    dash pattern=on 20mm off 8mm] (-\X,0) -- (\X,0) ;

    \begin{pgfonlayer}{foreground}
    \begin{scope}[shift={(\i,-.9)},xscale=-1]
    \ifthenelse{\frame=14}{%
        \duck[body=\K,speech={Coin !},bubblecolour=white!95!yellow]}{%
        \duck[body=\K]
        }
    \coordinate (LH) at (wing) ;
    \end{scope}
    \end{pgfonlayer}

    \begin{scope}[shift={(-\i,.6)}]
    \duck[body=\K]
    \coordinate (RH) at (wing) ;
    \end{scope}

\end{tikzpicture}
}
\end{document}
Tarass
  • 16,912
13

Visualization of a sinus function

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc} %probably not needed ...
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{papersize={128mm,96mm},margin=0.5cm} %\textwidth=11.8, \textheight=8.6
\usepackage[x11names]{xcolor}
\usepackage{tikzducks}
\usetikzlibrary{shapes.geometric}
\pagestyle{empty}
\parindent=0pt
\usepackage{eso-pic}
\usepackage{xfp}
\tikzstyle{witchstars}=[star, star points=5, star point ratio=2.25, draw,inner sep=1.3pt,anchor=outer point 3]



\begin{document}
\AddToShipoutPictureBG{%
 \AtPageLowerLeft{%
 \begin{tikzpicture}[overlay,remember picture]
 \fill[DeepSkyBlue3] (0,0) rectangle (\paperwidth,\paperheight);
 \pgfmathsetseed{2}
 \end{tikzpicture}}}

\newcommand\loopmax{30}

\foreach \z in {1,2,...,\loopmax}{%
\begin{tikzpicture}
\path (0,0) rectangle (\textwidth,\textheight);
\begin{scope}[scale=2]
%\draw[domain=0:10, black,smooth]   plot (\x,{sin(\x r)+0.5}) ;
\end{scope}
\begin{scope}[overlay,
              xshift=\fpeval{0.67-\z*(0.67/\loopmax)}\textwidth,
              yshift=\fpeval{sin(\z/\loopmax*2*pi)+0.5}cm ]
\begin{scope}[scale=2]

\duck[witch=black!50!gray,
longhair=red!80!black,
jacket=black!50!gray,
magicwand]
\fill[red] (0,0) node[witchstars,fill=red,inner sep=2.3pt]{};
\end{scope}
\end{scope}
\foreach \y in {1,2,...,\loopmax}{%
 \begin{scope}[overlay,
              xshift=\fpeval{0.67-\y*(0.67/\loopmax)}\textwidth,
              yshift=\fpeval{sin(\y/\loopmax*2*pi)+0.5}cm ]
 \fill[] (0,0) node[witchstars,fill=yellow,inner sep=1.3pt]{};
 \end{scope}
}

\end{tikzpicture}\newpage}

\end{document}
Ulrike Fischer
  • 327,261
12

It can be used to illustrate Occam's razor, which could be argued to be the epitome of scientific guessing:

If it looks like a duck, floats like a duck, and bobs its head like a duck, then obviously it is a duck! (Even if it is just a toy duck.)

toy duck

user21820
  • 868
  • 7
  • 19
  • 1
    Of course this raises the very tricky question of whether a "toy duck" is in fact a duck. – Alan Munn Mar 25 '18 at 14:06
  • 1
    @AlanMunn: That's a very interesting question, and incidentally I thought a lot about that very question before. My conclusion is that linguistically a "toy duck" is in fact a "duck", because an adjective can be treated as a function that on an input noun phrase produces an output that is also a noun phrase, appropriately modified from the input. There are 2 sorts of adjectives. One sort is an operator on its domain; its domain is closed under it. The other sort is not an operator on its domain. The adjective "toy" is an operator, while the adjective "fake" is not. – user21820 Mar 25 '18 at 14:52
  • @AlanMunn: Anyway, I deliberately made the example comical, rather than serious, and it's up to the dear reader to come up with the hard questions in philosophy of science/language. =D – user21820 Mar 25 '18 at 14:54
  • Well as my dissertation advisor once said: which would you prefer to be shot with, a gun or a toy gun? So it's not clear that 'toy' is substantially different from 'fake'. – Alan Munn Mar 25 '18 at 14:56
  • @AlanMunn: You're making a fallacious argument here. A brown duck is a duck. And a yellow duck is also a duck. But a brown duck is certainly not a yellow duck. Similarly, a toy gun is a gun, but that does not mean all guns are identical to a toy gun. – user21820 Mar 25 '18 at 15:09
  • I'm not really interested in having a serious debate about this in SE comments. You brought up the idea of different sorts of adjectives (which is definitely on the right track). I was just pointing out that 'toy' and 'fake' behave a lot more alike than 'fake' and 'red'. There are at least 4 different types of adjectives, semantically, intersective, (like 'red'), subsective like ('skillful') and (at least two types) of non-subsective, non-intersectives (like 'former' and 'fake'.) See https://pdfs.semanticscholar.org/8e12/7df875b4f56500138839403b583d258102e6.pdf for some discussion. – Alan Munn Mar 25 '18 at 15:27
  • @AlanMunn: We can continue discussion in this chat-room. Thanks for your linked PDF, but it in fact states clearly that evidence points towards the 'standard' classification as inaccurate. I maintain that "toy gun" is substantially different from "fake gun" because "toy" in "toy gun" restricts "gun" to include only those that are toys, while "fake" in "fake gun" actually produces a distinct concept rather than merely restricting the "gun" concept. Compare "toy model" and "fake model". =) – user21820 Mar 25 '18 at 15:48
  • Your conclusion may be correct, but the reasoning which got you there is not: toy is not an adjective. Toy duck is a noun phrase constructed with two nouns. – Peter Taylor Mar 26 '18 at 10:19
  • @PeterTaylor: That's an interesting claim, which I reject. Many lexicons agree with me that one of the meanings of "toy" is as an adjective, such as http://www.dictionary.com/browse/toy and https://www.merriam-webster.com/dictionary/toy and https://www.oxfordlearnersdictionaries.com/definition/english/toy_2. – user21820 Mar 26 '18 at 10:41
  • It's a shame they don't provide any justification for such an astonishing claim. The word toy doesn't do any of the things that distinguish adjectives: it can't form comparatives ("more toy" / "toyer", "too toy", "how toy?"), nor adverbs ("toyly"), nor follow a copula ("this duck is toy"). The most surprising of those you list is the last, because the full Oxford English Dictionary lists toy only as a noun and a verb. – Peter Taylor Mar 26 '18 at 19:06
  • @PeterTaylor These comments would have been better off in the chatroom for this thread. But for the purposes of the semantics being discussed, it's very likely that the Noun vs Adj distinction is not relevant. As long as 'toy' in 'toy gun' is a noun modifier an not part of an N-N compound noun (which it's not) the semantics can be the same. But I agree with you totally that 'toy' is never an adjective. – Alan Munn Mar 26 '18 at 21:26
  • @PeterTaylor: You should just come join our discussion in the chat-room! I suppose if you require an adjective to be able to act as a substantive (as in "is toy") and to form comparatives, then indeed "toy" is not. However, I disagree that all adjectives must be as you imply (in real language), such as "main" and "utmost" and "sheer". If you reject these as adjectives, what do you call them? – user21820 Mar 27 '18 at 07:35
9

Here are some ducks illustrating the need for sidelobe supression in radar. (I may have been a little bit inspired by this question, but I used this in a real presentation.)

radar ducks

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, shapes.arrows}
\usepackage{tikzducks}

%%% extract coordinate
\newdimen\XCoord
\newdimen\YCoord
\newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}        
{\YCoord};}%

%%% Waves, source: https://tex.stackexchange.com/questions/423489/concentric-circle-segments-between-two-points-in-tikz/423567#423567 
%#1=Number of waves
%#2 ans #3 point A and B
%#4 Angle of first wave
%#5 Colour of waves
\def\NumSignalsFromToAngle#1#2#3#4#5{%
    \def\NumberSignals{#1}
    \ExtractCoordinate{#2}
    \xdef\Xa{\XCoord}
    \xdef\Ya{\YCoord}
    \ExtractCoordinate{#3}
    \xdef\Xb{\XCoord}
    \xdef\Yb{\YCoord}
    \def\lw {2} %line width
    \pgfmathsetmacro\dist{10*sqrt((\Xb/10-\Xa/10)^2+(\Yb/10-\Ya/10)^2)}
    \pgfmathsetmacro\step{\dist/\NumberSignals}
    \def\offset{0.02*\dist}
    \pgfmathsetmacro\AngleFromAToB{\ifdim\Xb>\Xa atan((\Yb/10-\Ya/10)/(\Xb/10 -\Xa/10))\else \ifdim \Xb<\Xa 180+atan((\Yb/10-\Ya/10)/(\Xb/10 -\Xa/10))\else\ifdim\Ya>\Yb -90\else90\fi\fi\fi}
    \foreach \i in {1,...,\NumberSignals}
        {%
        \coordinate(Point) at ($(#2)+({((\step pt)*(2*\i-1)/2-\offset)*cos(\AngleFromAToB) },{(((\step pt)*(2*\i-1)/2-\offset)*sin(\AngleFromAToB)})$);
        \pgfmathsetmacro\r{\step/2*(2*\i-1)}
        %\l_1=\l_i => \angle_i=\angle_1/(2i-1)
        \pgfmathsetmacro\angle{#4/(2*\i-1)}
        \draw[line width = \lw, #5]  (Point) arc (\AngleFromAToB:    {\AngleFromAToB+\angle/2}:\r pt);
        \draw[line width = \lw, #5]  (Point) arc (\AngleFromAToB:{\AngleFromAToB-\angle/2}:\r pt);
    }
}

\begin{document}

\begin{tikzpicture}
    %%% radar
    \def\h{2} %height
    \def\xd{0.5} %x-depth
    \def\yd{0.12} %y-depth
    \def\xw{1.2}   %x-width
    \def\yw{1} %y-width
    \coordinate (A) at (0,0);
    \coordinate (B) at ($(A) + (\xd,\yd) $);
    \coordinate (C) at ($(B) + (0,\h)$);
    \coordinate (D) at ($(A) + (0,\h)$);
    \coordinate (E) at ($(A) + (-\xw, \yw)$);
    \coordinate (F) at ($(E) + (0, \h)$);
    \coordinate (G) at ($(F) + (\xd,\yd)$);

    \shade[bottom color=gray!90, top color=black!30](A) -- (B) -- (C) -- (D) -- (A);
    \shade[bottom color=gray!80, top color=black!10](A) -- (D) -- (F) -- (E) -- (A);
    \shade[bottom color=gray!80, top color=black!10] (D) -- (C) -- (G) -- (F) -- (D);

    \coordinate (radar) at ($ (A) !0.5! (F)$);

    %%% graduate duck
    \coordinate (T) at ($ (radar) + (-5,0) $);
    \begin{scope}[shift = {($(T) + (-1,-0.4)$)}, scale = 0.5]
        \duck[book=\scalebox{0.6}{$\beta$},
            bookcolour=blue!60!red!70!white,graduate=gray!20!black,
            tassel=red!70!black];
    \end{scope}
    \NumSignalsFromToAngle{6}{radar}{T}{130}{blue!70}
    \NumSignalsFromToAngle{6}{T}{radar}{130}{red!70}
    \coordinate (midpos) at ($(radar) !0.5! (T) $);
    \node[single arrow,fill=red!50, above = of midpos]  {\scriptsize reflected};
    \node[single arrow,fill=blue!50, below = of midpos, shape border rotate = 180]  {\scriptsize emitted};

    %%% kulturman duck 
    \coordinate (T) at ($ (radar) + (-2,2) $);
    \coordinate (R) at ($ (radar) + (0,\h/3) $);
    \begin{scope}[shift = {($(T) + (+0.2,-0.3)$)}, yscale=.5,xscale=-.5]
        \duck[crazyhair, wine=red!70!black];
    \end{scope}
    \NumSignalsFromToAngle{3}{T}{R}{130}{red!70}

    %%% mirror duck
    \coordinate (T) at ($ (radar) + (-0.5,-1.5) $);
    \coordinate (R) at ($ (radar) + (0,-\h/3) $);
    \begin{scope}[shift = {($(T) + (-1,-1)$)}, scale = 0.5]
        \duck[beret=red!40!blue!90!white, signpost, signback=white!80!brown];
    \end{scope}
    \NumSignalsFromToAngle{2}{R}{T}{130}{blue!50}
    \NumSignalsFromToAngle{2}{T}{R}{130}{red!70}

    %%% mystery duck
    \coordinate (T) at ($ (radar) + (-6,-2) $);
    \coordinate (R) at (radar);%($ (radar) + (\xw/2,-\h/3) $);
    \begin{scope}[shift = {($(T) + (0,-0.5)$)}, yscale=.5,xscale=-.5]
        \duck[mask=black,cape=black];
    \end{scope}
    \NumSignalsFromToAngle{7}{T}{R}{130}{red!70}
\end{tikzpicture}

\end{document}
blupp
  • 233
5

Dispersion of water waves

This answer can be seen as an extension to the answer for the Cherenkov effect. The effect is observed in the real world (just search for it or look into the relevant Wikipedia articles), when ducks (or boats, or anthing else) swim.

If a duck just sits in the water and wobbles up and down, we can observe circles of water waves. (the code for this duck is easily found in the manual)

wobbling duck

But when the duck swims with a (constant) velocity and naturally continues to wobble/continues to excite waves, these circles all have different origins. We would expect something like in the answer for the Cherenkov effect: Only in two direction for each wabe circle, there is a positive interference and two wavefronts should appear. The opening angle of the depends on the speed of the duck and the propagation speed of the water wave.

swimming duck in dispersion-free water

But this is not what is observed in reality! Water waves have a frequency-dependent speed of propagation (aka dispersion), and each emitted pulse (here denoted in time steps $\delta t$) has a group velocity and a different phase velocity. The angle where the constructive interference happens is determined by the groupd velocity because this one determines where the pulse is currently travelling, but inside this pulse, the phase velocity determines how the wavefront is oriented.

Overall, this leads to a picture like the following one.

swimming duck in real water

The angles are not correct because I am too lazy (I think, they are quite fixed due to physics.) Also the wavefront shape is probably not perfect.

Code for the first part

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{ducks}

\begin{document}

\begin{tikzpicture}
  \begin{scope}[rotate=30,] 
  \draw[gray] 
    (8,6) circle (3.55)
    (6,6) circle (2.68) 
    (4,6) circle (1.8) 
    (2,6) circle (0.9)     
  ;
  \draw [<->,very thick,gray] (2,6) -- (4,6) node[midway,above,rotate=30] {$v_\mathrm{duck}\Delta t$} ;
  \draw [<->,very thick,gray] (4,6) -- (6,6) node[midway,above,rotate=30] {$v_\mathrm{duck}\Delta t$} ;
  \draw [<->,very thick,gray] (6,6) -- (8,6) node[midway,above,rotate=30] {$v_\mathrm{duck}\Delta t$} ;
  \draw [ ->,very thick] (2,6) -- ({2-0.90*sin(28)},{6-0.90*cos(28)}) node[midway,right,rotate=00] {$v_\mathrm{wave}\Delta t$};
  \draw [ ->,very thick] (4,6) -- ({4-1.80*sin(28)},{6-1.80*cos(28)}) node[midway,above,rotate=-90] {$2v_\mathrm{wave}\Delta t$};
  \draw [ ->,very thick] (6,6) -- ({6-2.68*sin(28)},{6-2.68*cos(28)}) node[midway,above,rotate=-90] {$3v_\mathrm{wave}\Delta t$};
  \draw [ ->,very thick] (8,6) -- ({8-3.55*sin(28)},{6-3.55*cos(28)}) node[midway,above,rotate=-90] {$4v_\mathrm{wave}\Delta t$};
  \draw[blue,thick] (12,0) -- (0,6) -- (12,12);
  \draw[gray,dashed]  (0,6) -- (15,6);
  \draw (-.5,6) pic[scale=0.75] {duck};
  \end{scope}  


\end{tikzpicture}

\end{document}

Similar Code for the second part

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{ducks}

\begin{document}

\begin{tikzpicture}
  \begin{scope}[rotate=30,] 
  \draw[gray] 
    (8,6) circle (3.55)
    (6,6) circle (2.68) 
    (4,6) circle (1.8) 
    (2,6) circle (0.9)     
  ;
  \begin{scope}
  \clip (0,6) -- (1,7) -- (11,12) -- (11,11) -- (1,6) -- cycle;
  \foreach \x in {0.7,1.4,...,5}{
  \draw[ultra thick,blue] (\x,6) -- (\x+7,6+7);
  }
  \end{scope}
  \begin{scope}
  \clip (0,6) -- (1,5) -- (11,0) -- (11,1) -- (1,6) -- cycle;
  \foreach \x in {0.7,1.4,...,5}{
  \draw[ultra thick,blue] (\x,6) -- (\x+7,6-7);
  }
  \end{scope}
  \draw[blue!50!gray,semithick] (12,0) -- (0,6) -- (12,12);
  \draw[gray,dashed]  (0,6) -- (15,6);
  \draw (-.5,6) pic[scale=0.75] {duck};
  \end{scope}  


\end{tikzpicture}

\end{document}
crateane
  • 2,217