[pstricks] \psellipse
Michael J. Sharpe
msharpe at euclid.ucsd.edu
Tue Jan 16 23:34:48 CET 2001
At 9:12 PM +0000 1/16/01, Chris Sangwin wrote:
>Can one draw part of an ellipse easily, something of a cross between
>\psellipse and \psarc?
>
>I'm doing awful things with white \psframes at the moment. There must be
>something better?
>
>Thanks in advance.
>
>Chris
>
>
>_______________________________________________
>pstricks mailing list
>pstricks at tug.org
>http://tug.org/mailman/listinfo/pstricks
There isn't a native Postscript equivalent of psarc, but you could
achieve the effect in one of two ways:
(i) Use \pscustom to translate to the center of the ellipse, rotate
so that the new x axis is one of the axes of the ellipse, and scale
the (rotated) axes to get the eccentricity correct, then draw using
\psarc. For example
\input pstricks
{Piece of an ellipse.}
\vskip4pc
\pspicture(0,10)(0,10)
\psgrid(0,0)(10,10)
\pscustom{\translate(5,5)
\rotate{30}
\scale{1.6 1}
\psarc(0,0){3}{-10}{105}
}
\endpspicture
\end
(ii) Give a parametric form of your ellipse to \parametricplot. One
simple parametric specification of a general ellipse with center
(x0,y0) is (for suitably chosen semi-major axes a, b, and rotation
angle c)
x=x0+a cos t cos c -b sin t sin c,
y=y0+ b cos t sin c +b sin t cos c
from which you may easily specify the Postscript code needed.
Michael Sharpe
More information about the PSTricks
mailing list