Utilisateurs de Perl à Paris

À propos de la censure et à propos des marées

Un historique de toutes nos réunions


Retour au compte-rendu

% -*- encoding: utf-8 -*-
%
%     Construction des dessins illustrant le mécanisme des marées
%    Building a few drawings for the explanation of tides
%     Copyright (C) 2018 Jean Forget
%
%     This program is distributed under the same terms as Perl 5.16.3:
%     GNU Public License version 1 or later and Perl Artistic License.
%
%    Here is the summary of GPL:
%
%    This program is free software; you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation; either version 1, or (at your option)
%    any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program; if not, write to the Free Software Foundation,
%    Inc., https://www.fsf.org/.
%

\documentclass[a4paper]{article}
\usepackage{luamplib}
\directlua{dofile("maree.lua")}

\begin{document}

Dessin de base

\vspace{1cm}

\begin{mplibcode}
beginfig(1);

draw (0,0) -- (200,0);

draw (50,0) .. (0,50) .. (-50,0) .. (0,-50) .. cycle;
draw (60,0) .. (0,52) .. (-60,0) .. (0,-52) .. cycle;
label.rt("Terre", (45,-45));

draw (220,0) .. (200,20) .. (180,0) .. (200,-20) .. cycle;
label.rt("Lune", (220,-20));

endfig;
\end{mplibcode}

\vspace{1cm}

Marée de vive-eau

\vspace{1cm}

\begin{mplibcode}
beginfig(1);

draw (-200,0) -- (200,0);

draw (50,0) .. (0,50) .. (-50,0) .. (0,-50) .. cycle;
draw (60,0) .. (0,52) .. (-60,0) .. (0,-52) .. cycle;
label.rt("Terre", (45,-45));

draw (220,0) .. (200,20) .. (180,0) .. (200,-20) .. cycle;
label.rt("Lune", (200,-30));

draw (-220,0) .. (-200,20) .. (-180,0) .. (-200,-20) .. cycle;
label.rt("Soleil", (-200,-30));

endfig;
\end{mplibcode}

\eject

Marée de morte-eau

\vspace{1cm}

\begin{mplibcode}
beginfig(1);

draw (0,200) -- (0,0) -- (200,0);

draw (50,0) .. (0,50) .. (-50,0) .. (0,-50) .. cycle;
draw (54,0) .. (0,54) .. (-54,0) .. (0,-54) .. cycle;
label.rt("Terre", (45,-45));

draw (220,0) .. (200,20) .. (180,0) .. (200,-20) .. cycle;
label.rt("Lune", (200,-30));

draw (20,200) .. (0,220) .. (-20,200) .. (0,180) .. cycle;
label.rt("Soleil", (0,170));

endfig;
\end{mplibcode}

\vspace{1cm}

Aspect dynamique

\vspace{1cm}

\begin{mplibcode}
beginfig(1);

draw (50,0) .. (0,50) .. (-50,0) .. (0,-50) .. cycle withcolor (0.5, 0.5, 1);
draw (60,0) .. (0,52) .. (-60,0) .. (0,-52) .. cycle withcolor (0.5, 0.5, 1);
label.rt("Terre", (45,-45));

draw (220,0) .. (200,20) .. (180,0) .. (200,-20) .. cycle;
label.rt("Lune", (220,-20));

drawarrow (55,0) .. (20,0);
drawarrow (55,0) .. (65,0);
dotlabel.bot("A", (55,0));
label.lrt(btex $ \overrightarrow{F} $ etex, (65,0));
label.llft(btex $\overrightarrow{P} $ etex, (20,0));

drawarrow (0,52) .. (10,52);
drawarrow (0,52) .. (0,17);
dotlabel.ulft("B", (0,52));
label.urt(btex $ \overrightarrow{F} $ etex, (10,52));
label.llft(btex $\overrightarrow{P} $ etex, (0,17));

endfig;
\end{mplibcode}

\eject

\directlua{battement(50,10,50,11)}

\directlua{battement(60,10,20,11)}

\end{document}

HTML 5 - CSS v3 Mongueurs de Paris, le 16 octobre 2018 Copyright © The Paris Perl Mongers, 1999-2024