%%%% cycld_2.ldf %%%% Created by Laurence D. Finston (LDF) Fri Jan 9 09:34:56 CET 2009 %%%% $Id: cycld_2.ldf,v 1.3 2010/12/17 14:47:40 lfinsto1 Exp $ %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2008, 2009, 2010, 2011 The Free Software Foundation %%%% 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 sending %%%% 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 Free Software Foundation, Inc. %%%% 51 Franklin St, Fifth Floor %%%% Boston, MA 02110-1301 %%%% USA %%%% Laurence.Finston@gmx.de %% Last updated: January 9, 2009 %% Run like this: %% 3dldf cycld_2.ldf %% mpost cycld_2.mp %% tex cycld_2.txt %% dvips -o cycld_2.ps cycld_2.dvi %% ps2pdf cycld_2.ps %% All on one line: if false: 3dldf cycld_2.ldf && mpost cycld_2.mp && tex cycld_2.txt && \ dvips -o cycld_2.ps cycld_2.dvi \ && ps2pdf cycld_2.ps fi; %% View using Ghostview like this: %% gv cycld_2.ps & %% or with GNU Ghostview like this: %% ggv cycld_2.ps & %% Convert the final EPS image to JPEG like this: %% conveps --start=1211 --end=1211 --output-format=jpeg --border=0 cycld_2 %% Convert EPS files to JPEG like this: %% conveps --start=1 --end=1211 --output-format=jpeg --border=0 cycld_2 %% Generate animated GIF like this: %% convert -delay 15 cycld_2_*.jpg cycld_2.gif %% %% Other formats can be used; it doesn't have to be JPEG. %% The animated GIF can be viewed using the `animate' program from ImageMagick: %% animate cycld_2.gif %% * (1) Beginning of 3DLDF code. %% !! TODO: Make a correction in cycld_1.ldf. Regenerate files. %% LDF 2009.01.09. %% ** (2) Cycloid Pattern 2 %% *** (3) Declarations and Other Preliminaries pickup pencircle scaled (.675mm, .675mm, .675mm); circle c[]; point p[]; path q[]; transform t[]; m := 7; n := 7; %% Color vector cv color_vector cv; if false: %if true: cv += black; cv += black; cv += black; cv += black; cv += black; cv += black; cv += black; cv += black; cv += black; cv += black; else: cv += black; cv += blue; cv += black; %% q2 is the frame path cv += red; cv += green; cv += magenta; cv += cyan; cv += blue; cv += red; cv += green; cv += magenta; cv += cyan; cv += blue; cv += red; cv += green; cv += magenta; cv += cyan; cv += blue; cv += red; cv += green; cv += magenta; cv += cyan; cv += blue; cv += red; cv += green; cv += magenta; cv += cyan; fi; %% Frame q2 := (-m, 0, -n) -- (m, 0, -n) -- (m, 0, n) -- (-m, 0, n) -- cycle; numeric d[]; %% Diameters d0 := 5; d1 := d0 / 5; numeric r[]; %% Radii r0 := .5d0; r1 := .5d1; set c0 with_diameter d0 with_point_count 32; %% Large circle --- base. set c1 with_diameter d1; %% Small circle --- rolling circle. pi := 3.141592653589793; alpha := 3 * 2pi / 360; %% 3° --> radians dist := r0 * alpha; %% I don't remember what the point of this is. %% LDF 2009.01.09. %if true: if false: message "2pi:"; show 2pi; message "dist:"; show dist; fi; beta := dist / r1; %% angle of rotation of c1 about its center. if false: message "beta in radians:"; show beta; message "alpha in radians:"; show alpha; fi; alpha *= 180; alpha /= pi; beta *= 180; beta /= pi; if true: %if false: message "alpha in deg:"; show alpha; message "beta in deg.:"; show beta; fi; %% *** (3) First Cycloid Path %% **** (4) Move c1 to the perimeter of c0. p0 := get_point 8 c0; %% The first point on the cycloid path. %% p0 will successively be set to the points %% on the cycloid path shift c1 by p0; shift c1 by (0, 0, .5d1); circle save_circle; save_circle := c1; %% Axis of rotation about the center of c1. p1 := get_center c1; p2 := p1 shifted (0, 1); q0 := origin -- p1; q1 += p0; %% First point on path q1. t0 := identity rotated (0, alpha); %% Rotation about the center of %% c0 (the base circle) %% **** (4) Figure 0 (Dummy figure) beginfig(0); drawdot origin; endfig with_projection parallel_x_z no_sort; %% **** (4) Figure 1 beginfig(1); draw p0 -- p1; %% Draw line from center of c1 to the current point on the %% cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c1; %% rolling circle (small) draw q0; %% The line between the centers of the circles %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% **** (4) Figures 2 -- 121 for i = 2 upto 121: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c1 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c1 (the rolling circle) p0 *= c1 *= t1; q1 += ..; %% Add next point on the cycloid path q1 += p0; draw p1 -- p0; %% Line from the center of c1 to the current %% point on the cycloid path draw c0; %% Base circle draw c1; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv[1]; %% The cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q1 += cycle; %% Make the cycloid path a cycle. %% *** (3) Second cycloid path %% **** (4) Figure 122 beginfig(122); t2 := identity rotated (0, 15); c1 *= p0 *= p1 *= p2 *= q0 *= t2; q3 += p0; %% The first point on the current (second) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current point on the %% current cycloid path draw q1 with_color cv1; %% previous (first) cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c1; %% rolling circle (small) draw q0; %% The line between the centers of the circles %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% **** (4) Figures 123 -- 242 for i = 123 upto 242: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c1 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c1 (the rolling circle) p0 *= c1 *= t1; q3 += ..; %% Add next point on the current (second) cycloid path q3 += p0; draw p1 -- p0; %% Line from the center of c1 to the current %% point on the cycloid path draw c0; %% Base circle draw c1; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% previous (first) cycloid path draw q3 with_color cv3; %% current (second) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q3 += cycle; %% Make the second cycloid path a cycle. %% *** (3) Third cycloid path %% **** (4) Figure 243 beginfig(243); c1 *= p0 *= p1 *= p2 *= q0 *= t2; q4 += p0; %% The first point on the current (third) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current cycloid path draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c1; %% rolling circle (small) draw q0; %% The line between the centers of the circles %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% **** (4) Figures 244 -- 363 for i = 244 upto 363: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c1 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c1 (the rolling circle) p0 *= c1 *= t1; q4 += ..; %% Add next point on the current (third) cycloid path q4 += p0; draw p1 -- p0; %% Line from the center of c1 to the current %% point on the cycloid path draw c0; %% Base circle draw c1; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% current (third) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q4 += cycle; %% Make the third cycloid path a cycle. %% *** (3) Fourth cycloid path %% **** (4) Figure 364 beginfig(364); c1 *= p0 *= p1 *= p2 *= q0 *= t2; q5 += p0; %% The first point on the current (fourth) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current cycloid path draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c1; %% rolling circle (small) draw q0; %% The line between the centers of the circles %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% **** (4) Figures 365 -- 484 for i = 365 upto 484: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c1 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c1 (the rolling circle) p0 *= c1 *= t1; q5 += ..; %% Add next point on the current (fourth) cycloid path q5 += p0; draw p1 -- p0; %% Line from the center of c1 to the current %% point on the cycloid path draw c0; %% Base circle draw c1; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q5 with_color cv5; %% current (fourth) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q5 += cycle; %% Make the fourth cycloid path a cycle. %% *** (3) Fifth cycloid path %% **** (4) Figure 485 beginfig(485); c1 *= p0 *= p1 *= p2 *= q0 *= t2; q6 += p0; %% The first point on the current (fifth) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current cycloid path draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q5 with_color cv5; %% fourth cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c1; %% rolling circle (small) draw q0; %% The line between the centers of the circles %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% **** (4) Figures 486 -- 605 for i = 486 upto 605: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c1 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c1 (the rolling circle) p0 *= c1 *= t1; q6 += ..; %% Add next point on the current (fifth) cycloid path q6 += p0; draw p1 -- p0; %% Line from the center of c1 to the current %% point on the cycloid path draw c0; %% Base circle draw c1; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q5 with_color cv5; %% fourth cycloid path draw q6 with_color cv6; %% current (fifth) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q6 += cycle; %% Make the fifth cycloid path a cycle. %% ***** (5) End of Figures 486 -- 605 %% **** (4) %% *** (3) Small circle rolled about the inside of the base (large) circle. beginfig(606); c2 := save_circle; shift c2 (0, 0, -d1); draw c2; %% Axis of rotation about the center of c2. p1 := get_center c2; p2 := p1 shifted (0, 1); p0 := get_point 8 c2; q0 := origin -- p1; draw p0 -- p1; %% Draw line from center of c1 to the current point on the %% cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c2; %% rolling circle (small) draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q5 with_color cv5; %% fourth cycloid path draw q6 with_color cv6; %% current (fifth) cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.top("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of figure 606 %% **** (4) Figures 607 -- 726 for i = 607 upto 726: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c2 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c2 (the rolling circle) p0 *= c2 *= t1; q7 += ..; %% Add next point on the cycloid path q7 += p0; draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path draw c0; %% Base circle draw c2; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first cycloid path draw q3 with_color cv3; %% second cycloid path draw q4 with_color cv4; %% third cycloid path draw q5 with_color cv5; %% fourth cycloid path draw q6 with_color cv6; %% fifth cycloid path draw q7 with_color cv7; %% The cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; endfor; q7 += cycle; %% Make the cycloid path a cycle. %% *** (3) Second inner cycloid path %% **** (4) Figure 727 beginfig(727); c2 *= p0 *= p1 *= p2 *= q0 *= t2; q8 += p0; %% The first point on the current (second) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current outer cycloid path draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c2; %% inner rolling circle (small) draw q0; %% The line between the centers of the circles draw q7 with_color cv7; %% first inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figure 727 %% **** (4) Figures 728 -- 847 for i = 728 upto 847: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c2 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c2 (the rolling circle) p0 *= c2 *= t1; q8 += ..; %% Add next point on the cycloid path q8 += p0; draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path draw c0; %% Base circle draw c2; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q6 with_color cv6; %% fifth outer cycloid path draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second (current) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figures 728 -- 847 endfor; q8 += cycle; %% Make the cycloid path a cycle. %% *** (3) Third inner cycloid path %% **** (4) Figure 848 beginfig(848); c2 *= p0 *= p1 *= p2 *= q0 *= t2; q9 += p0; %% The first point on the current (third) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current outer cycloid path draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c2; %% inner rolling circle (small) draw q0; %% The line between the centers of the circles draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figure 848 %% **** (4) Figures 849 -- 968 for i = 849 upto 968: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c2 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c2 (the rolling circle) p0 *= c2 *= t1; q9 += ..; %% Add next point on the cycloid path q9 += p0; draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path draw c0; %% Base circle draw c2; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q6 with_color cv6; %% fifth outer cycloid path draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third (current) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figures 849 upto 968: endfor; q9 += cycle; %% Make the last inner cycloid path a cycle. %% *** (3) Fourth inner cycloid path %% **** (4) Figure 969 beginfig(969); c2 *= p0 *= p1 *= p2 *= q0 *= t2; q10 += p0; %% The first point on the current (fourth) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current outer cycloid path draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c2; %% inner rolling circle (small) draw q0; %% The line between the centers of the circles draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figure 969 %% **** (4) Figures 970 -- 1089 for i = 970 upto 1089: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c2 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c2 (the rolling circle) p0 *= c2 *= t1; q10 += ..; %% Add next point on the cycloid path q10 += p0; draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path draw c0; %% Base circle draw c2; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q6 with_color cv6; %% fifth outer cycloid path draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third inner cycloid path draw q10 with_color cv10; %% fourth (current) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figures 970 -- 1089 endfor; q10 += cycle; %% Make the last inner cycloid path a cycle. %% *** (3) Fifth inner cycloid path %% **** (4) Figure 1090 beginfig(1090); c2 *= p0 *= p1 *= p2 *= q0 *= t2; q11 += p0; %% The first point on the current (fifth) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; draw p0 -- p1; %% Draw line from center of c1 to the current %% point on the current outer cycloid path draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q2; %% The frame draw c0; %% base circle (large) draw c2; %% inner rolling circle (small) draw q0; %% The line between the centers of the circles draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third inner cycloid path draw q10 with_color cv10; %% fourth inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figure 969 %% **** (4) Figures 1091 -- 1210 for i = 1091 upto 1210: beginfig(i); draw q2; %% The frame p0 *= p1 *= p2 *= c2 *= q0 *= t0; t1 := identity rotated_around (p1, p2) beta; %% Rotation about the center of %% c2 (the rolling circle) p0 *= c2 *= t1; q11 += ..; %% Add next point on the cycloid path q11 += p0; draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path draw c0; %% Base circle draw c2; %% Rolling circle draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q6 with_color cv6; %% fifth outer cycloid path draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third inner cycloid path draw q10 with_color cv10; %% fourth inner cycloid path draw q11 with_color cv11; %% fifth (current) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figures 1091 -- 1210 endfor; q11 += cycle; %% Make the last inner cycloid path a cycle. %% **** (4) Figures 1211 beginfig(1211); draw q2; %% The frame % draw p1 -- p0; %% Line from the center of c2 to the current %% point on the cycloid path % draw c0; %% Base circle % draw c2; %% Rolling circle % draw q0; %% The line between the centers of the circles draw q1 with_color cv1; %% first outer cycloid path draw q3 with_color cv3; %% second outer cycloid path draw q4 with_color cv4; %% third outer cycloid path draw q5 with_color cv5; %% fourth outer cycloid path draw q6 with_color cv6; %% fifth outer cycloid path draw q7 with_color cv7; %% first inner cycloid path draw q8 with_color cv8; %% second inner cycloid path draw q9 with_color cv9; %% third inner cycloid path draw q10 with_color cv10; %% fourth inner cycloid path draw q11 with_color cv11; %% fifth (current) inner cycloid path %if true: if false: dotlabel.bot("o", origin); dotlabel.lrt("$p_0$", p0); dotlabel.rt("$p_1$", p1); fi; endfig with_projection parallel_x_z no_sort; %% End of Figure 1211 %% *** (3) End of 3DLDF code verbatim_metapost "end;"; end; %% ** (2) %% * (1) Emacs-Lisp code for use in indirect buffers when using the %% GNU Emacs editor. The local variable list is not evaluated when an %% indirect buffer is visited, so it's necessary to evaluate the %% following s-expression in order to use the facilities normally %% accessed via the local variables list. %% \initials{LDF 2004.02.12}. %% (progn (metafont-mode) (outline-minor-mode t) (setq fill-column 80) (ignore '( %% )) (setq outline-regexp "%% [*\f]+")) %% * (1) Local variables for Emacs. %% Local Variables: %% mode:Metafont %% eval:(outline-minor-mode t) %% eval:(read-abbrev-file abbrev-file-name) %% outline-regexp:"%% [*\f]+" %% End: