[pstricks] part of an ellipse
Christophe JORSSEN
christophe.jorssen at noos.fr
Mon Oct 7 11:27:54 CEST 2002
Hi,
Denis gave me this answer a few years ago, but it doesn't handle arrows...
Christophe
-----------------------------------------------------
\documentclass{article}
\usepackage{pstricks}
\makeatletter
% Arc of ellipse (but without arrows and "showpoints" parameter...)
% D.G. - Feb. 18, 1999
\def\psarcellipse{\pst at object{psarcellipse}}
\def\psarcellipse at i(#1){\@ifnextchar(%
{\psarcellipse at ii(#1)}{\psarcellipse at ii(0,0)(#1)}}
\def\psarcellipse at ii(#1)(#2)#3#4{%
\psarcellipse at iii(#1)(#2){#3}{#4}}
\def\psarcellipse at iii(#1)(#2)#3#4{%
\begin at ClosedObj
\pst at getcoor{#1}\pst at tempa
\pst@@getcoor{#2}%
\addto at pscode{%
%0 360
#3 #4
\pst at coor
\ifdim\psk at dimen\p@=\z@\else
\psk at dimen CLW mul
dup 4 -1 roll sub neg 3 1 roll sub
\fi
\pst at tempa
\tx at Ellipse
%closepath}%
}%
%\def\pst at linetype{2}%
\def\pst at linetype{0}%
\showpointsfalse
\end at ClosedObj}
\makeatother
\pagestyle{empty}
\begin{document}
\psset{subgriddiv=0}
\begin{pspicture}(5,5)\psgrid
\psellipse(1.5,1)(1.5,1)
\psarcellipse[linewidth=0.1](2,3)(1.5,1){0}{180}
\psarcellipse[linecolor=red,linestyle=dotted](4,2)(0.5,1){30}{220}
\end{pspicture}
\hfill
\begin{pspicture}(5,5)\psgrid
\psarc[linewidth=0.1,arrowscale=2]{<->}(1.5,1){1.5}{0}{180}
\psarc[showpoints=true](2,3){1}{30}{120}
\end{pspicture}
\end{document}
More information about the PSTricks
mailing list