%%%% elpsd_06.ldf %%%% Created by Laurence D. Finston (LDF) Wed Dec 7 20:16:45 CET 2005 %% * (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 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. %%%% It is also available from %%%% http://www.dante.de/software/ctan/, the Dante www-server %%%% and from http://wwwuser.gwdg.de/~lfinsto1, %%%% the author's website. %%%% Please send bug reports to lfinsto1@gwdg.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 %%%% lfinsto1@gwdg.de %%%% s246794@stud.uni-goettingen.de %% *** (3) The location of a `point p' with respect to an `ellipsoid e'. %% `location' returns 0 if `p' lies on the surface of `e', %% 1 if `p' lies within `p', and -1 if it lies outside of `e'. %% %% LDF 2005.12.07. verbatim_metapost "verbatimtex \magnification=\magstep5 \font\large=cmr12 etex"; pickup pencircle scaled (1mm, 1mm); picture save_picture; focus f; set f with_position (-10, 15, -30) with_direction (-10, 15, 100) with_distance 20; beginfig(1); ellipsoid E; set E with_center origin with_axis_x 24 with_axis_y 16 with_axis_z 10 with_divisions_x 8 with_divisions_y 8 with_divisions_z 2 with_point_count 64; %rotate E (15, 15); %shift E (1, 2, 3); draw E; point p[]; p0 := (1, 2, 1); %% Inside. p1 := (4, 9, 0); %% Outside. ellipse e; e := get_ellipse 3 E; p2 := get_point 60 e; %% On the surface. message "p0 location E:"; show p0 location E; message "p1 location E:"; show p1 location E; message "p2 location E:"; show p2 location E; pickup pencircle scaled (1.5mm, 1.5mm); pickup red; drawdot p0; drawdot p1; drawdot p2; label.ulft("$p_0$", p0); label.top("$p_1$", p1); label.urt("$p_2$", p2); endfig with_focus f no_sort; verbatim_metapost "end"; end;