%%%% ellpln01.ldf %%%% Created by Laurence D. Finston (LDF) Wed Nov 2 22:11:38 CET 2005 %% * (1) Copyright and License. %%%% This file is part of GNU 3DLDF, a package for three-dimensional drawing. %%%% Copyright (C) 2003, 2004, 2005 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 2 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 %% * (1) The intersection of an `ellipsoid' and a `plane'. %% The figure formed is an `ellipse'. %% LDF 2005.11.02. verbatim_metapost "verbatimtex \magnification=\magstep3 \font\large=cmr17 etex"; picture save_picture; focus f; set f with_position (-1, 5, -20) with_direction (-1, 5, 10) with_distance 20; ellipsoid e; set e with_center (0, 0, 0) with_axis_x 15 with_axis_y 8 with_axis_z 10 with_divisions_x 16 with_divisions_y 16 with_divisions_z 2 with_point_count 64; rotate e (0, 15, 0); shift e (-1, -1, 3); ellipse g; rectangle r; r := unit_rectangle scaled 15; rotate r (0, 15, 45); shift r by 1; path_vector pv; %% ***** (5) Figure 1. beginfig(1); draw r with_color blue; draw e; string s; pickup pencircle scaled (1.5mm, 1.5mm); bool_point_vector bpv; point pt; e_size := size e; for i = 0 upto e_size - 1: g := get_ellipse (i) e; bpv := g intersection_points r; for j = 0 upto size bpv - 1: pt := bpv[j]; if pt is_on_ellipse g: drawdot bpv[j] with_color red; fi; endfor; clear bpv; endfor; save_picture := current_picture; output current_picture with_focus f no_sort; clear current_picture; label("{\large Perspective}", (2, -15)); endfig with_projection parallel_x_y; %% ***** (5) beginfig(2); output save_picture with_projection parallel_x_y; label("{\large X-Y}", (0, -10)); endfig with_projection parallel_x_y; %% ***** (5) beginfig(3); output save_picture with_projection parallel_x_z; label("{\large X-Z}", (0, -10)); endfig with_projection parallel_x_y; %% ***** (5) beginfig(4); output save_picture with_projection parallel_z_y; label("{\large Z-Y}", (0, -10)); endfig with_projection parallel_x_y; verbatim_metapost "end"; end;