%% $Id: xyarc.doc,v 3.4 1997/05/18 01:13:24 ross Exp $ %% %% Xy-pic ``Circles, Ellipses and Arcs'' feature. %% Copyright (c) 1995-1997 Ross Moore %% %% This file is part of the Xy-pic package for graphs and diagrams in TeX. %% See the companion README and INSTALL files for further information. %% Copyright (c) 1991-1997 Kristoffer H. Rose %% %% The XY-pic package 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. %% %% The XY-pic package 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 package; if not, write to the Free Software Foundation, Inc., %% 675 Mass Ave, Cambridge, MA 02139, USA. %% \ifx\xyloaded\undefined \input xy \fi \xyprovide{arc}{Circle, Ellipse, Arc feature}{\stripRCS$Revision: 3.4 $}% {Ross Moore}{ross@mpce.mq.edu.au}% {Mathematics Department, Macquarie University, NSW~2109, Australia} \DOCMODE3%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \noindent This feature provides a means to a specify circles of arbitrary radius, drawn with a variety of line styles. Similarly ellipses may be specified, having arbitrary major/minor axes aligned in any direction. A circular arc joining two points can be constructed with specified tangent direction at one end. All the curves described here---circles, ellipses and sectors of these---are constructed using the curves from the |xycurve| extension. As such any comments given there concerning memory requirements are equally valid here, perhaps even more so. Use of the |xyps| \PS\ back-end is highly recommended. \DOCMODE2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \paragraph*{Header:}\leavevmode \DOCHEADER The arcs are not truly circular or elliptical, but are approximations given by cubic B\'ezier segments. Hence the |xycurve| feature must be loaded. \DOCMODE( \xyrequire{curve} \xycatcodes \DOCMODE) The basic defined here is |\arc|. So far it is only implemented as a ation, called |\ellipse|. \DOCMODE( \xydef@\ellipse#1#{\xy@{ELLIPSE}{\hbox\bgroup\save@}% \let\endarc@=\endellipse@@ \xyFN@\preARC@ #1@} \xydef@\endellipse@@{\xy@{endELLIPSE}{\leave@\origDirection@ \edef\next@{\egroup \X@min=\the\X@min \X@max=\the\X@max \Y@min=\the\Y@min \Y@max=\the\Y@max }\next@}\let\bstartPLACE@=\relax} \xydef@\preARC@{% \ifx\next\space@ \expandafter\DN@\space{\xyFN@\preARC@}% \else\ifx\next @\DN@{\xy@{ellipseARC}\ellipticARC@ \arc@}% \else\ifx\next ~\DN@~##1{\tildeARC@{##1}}% \else\DN@{\xy@{ellipticARC}\ellipticARC@ \arc@}% \fi\fi\fi \next@ } %\xydef@\arc#1#{\xy@{ARC}{\hbox\bgroup\save@}% % \let\endarc@=\endarc@@\arc@{#1}} %\xydef@\endarc@@{\xy@{endARC}{\leave@\origDirection@ \DOCMODE) We start by recording the curve