%%%% wave_1.ldf %%%% Created by Laurence D. Finston (LDF) Fri Mar 3 18:49:02 CET 2006 %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 The Free Software Foundation, Inc. %%%% GNU 3DLDF 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 3 of the License, or %%%% (at your option) any later version. %%%% GNU 3DLDF 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 GNU 3DLDF; if not, write to the Free Software %%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA %%%% GNU 3DLDF is a GNU package. %%%% It is part of the GNU Project of the %%%% Free Software Foundation %%%% and is published under the GNU General Public License. %%%% See the website http://www.gnu.org %%%% for more information. %%%% GNU 3DLDF is available for downloading from %%%% http://www.gnu.org/software/3dldf/LDF.html. %%%% Please send bug reports to Laurence.Finston@gmx.de %%%% The mailing list help-3dldf@gnu.org is available for people to %%%% ask other users for help. %%%% The mailing list info-3dldf@gnu.org is for the maintainer of %%%% GNU 3DLDF to send announcements to users. %%%% To subscribe to these mailing lists, send an %%%% email with ``subscribe '' as the subject. %%%% The author can be contacted at: %%%% Laurence D. Finston %%%% c/o The Free Software Foundation, Inc. %%%% 51 Franklin St, Fifth Floor %%%% Boston, MA 02110-1301 %%%% USA %%%% Laurence.Finston@gmx.de %% !! Important: LDF 2010.10.15. %% I've commented-out some code and rearranged some other code. %% The MetaPost code generated from this file (in `wave_1.mp') must be altered %% slightly by hand. I've check the latter file into the CVS repository. %% This is necessary, because problems have arisen with |Picture::output| that didn't exist %% with an older version of GCC. %% *** (3) Wave forms 1. LDF 2006.03.03. picture frame_picture; beginfig(0); path frame; frame := unit_rectangle rotated 90 scaled (16, 16) shifted (8, 0); draw frame with_pen pencircle scaled (.5mm, .5mm, .5mm); frame_picture := current_picture; endfig; point p; path null_path; k := 36; sign := 1; t := 143; for j = 0 upto 71: path q; if (j == 36): sign *= -1; fi; k -= sign; for i = 0 upto 36: m := i * 360 / 16; n := (sind m) * k / 36; p := (.5 * i, 2 * n * sign); q += p; endfor; q += ..; beginfig(j + 1); draw q with_pen pencircle scaled (1mm, 1mm); % output current_picture with_projection parallel_x_y; % clear current_picture; % output frame_picture with_projection parallel_x_y; endfig with_projection parallel_x_y; clip_to frame; beginfig(t); draw q with_pen pencircle scaled (1mm, 1mm); % output current_picture with_projection parallel_x_y; % clip_to frame; % clear current_picture; % output frame_picture with_projection parallel_x_y; endfig with_projection parallel_x_y; draw frame; clip_to frame; t -= 1; endfor; verbatim_metapost "end"; end;