# How to make use of the current point as the center of \psarc?

I want to make use of the current point as the center of \psarc, is it possible? The following code does not compile as the center of \psarc has not been specified yet.

\documentclass[pstricks,border=12pt]{standalone}
\SpecialCoor

\begin{document}
\begin{pspicture}(6,6)
\pscustom
{
\psarc(3,3){1}{0}{90}
\rmoveto(.5;-90)
\psarc(<current point>){.5}{90}{180}
}
\end{pspicture}
\end{document}


## Application

Having got an excellent answer from Herbert, I now can produce this toy.

\documentclass[pstricks,border=12pt]{standalone}
\SpecialCoor
\usepackage{multido}
\pstVerb{/R .75 def}
\makeatletter
\def\Atom#1{%
\begin{pspicture}[showgrid](2,2)(5,5)
\pscustom[linecolor=red]
{
\moveto(4,3)
\multido{\i@=0+1}{#1}
{%
\rmoveto(!\i@\space dup R exch exp exch 90 mul 180 sub PtoC)
\psarc[liftpen=2](!CP \tx@UserCoor){!\i@\space R exch exp}{!\i@\space 90 mul}{!\i@\space 90 mul 90 add}
}
}
\end{pspicture}}
\makeatother

\begin{document}
\multido{\i=1+1}{15}{\Atom{\i}}
\end{document}


-

\documentclass[pstricks,border=12pt]{standalone}
\SpecialCoor

\begin{document}
\makeatletter
\begin{pspicture}[showgrid](2,2)(5,5)
\pscustom{
\psarc(3,3){1}{0}{90}
\rmoveto(.5;-90)
\psarc[liftpen=2](!CP \tx@UserCoor){.5}{90}{180}%% liftpen is important
}
\end{pspicture}
\end{document}


The pstricks.tex version 2.47 from http://texnik.dante.de/tex/generic/pstricks/ knows a special coordinate (!!CP ) (double !!) which doesn't need the translation into user coordinates.

-
\translate(!!CP ) a space is needed! We have PostScript. Internally it will be translated into CP translate and without the space into CPtranslate. –  Herbert Nov 29 '13 at 11:56
OK. Thanks. But it should be regarded as a tiny bug that should be fixed I think. Why? Because normally we (as users) don't need to care about the trailing space. :-) –  stalking is prohibited Nov 29 '13 at 13:17

The following code does compile, however I had the problem that the command rmoveto was not found. I did change the polar coordinate to cartesian, that will probably make you trouble if you want to draw a spiral.

\documentclass[pstricks,border=12pt]{standalone}
\SpecialCoor

\begin{document}
\begin{pspicture}[showgrid=true](6,6)
\pscustom
{
\psarc(3,3){1}{0}{90}
\pstVerb{0 -0.5 rmoveto}
\psarc{-}{.5}{90}{180}
}
\end{pspicture}
\end{document}


The solution to the current point coordinate problem of the second arc is to give {-} as arrow argument, since either the arrows argument or the (x,y) argument must be included.

Here is a second variant with polar coordinates by defining an object to perform the translation.

\documentclass[pstricks,border=12pt]{standalone}
\SpecialCoor

\makeatletter
\def\myrmoveto{\pst@object{myrmoveto}}
\def\myrmoveto@i(#1){{%
\pst@killglue%
\pst@getcoor{#1}{\pst@tempa}
\pstVerb{\pst@tempa /yc exch def /xc exch def xc yc rmoveto}
}}%
\makeatother

\begin{document}
\begin{pspicture}[showgrid=true](6,6)
\pscustom
{
\psarc(3,3){1}{0}{90}
\myrmoveto(0.5;90)
\psarc{-}{.5}{90}{180}
}
\end{pspicture}
\end{document}


EDIT: Neither of these examples actually work. Apparently I had the coordinates for the second psarc hard coded when I tested, and then changed a few things without proper testing. My bad. And not giving the coordinates let pstricks assume it is (0,0).

-
Making this example made rather curious regarding the differences between '\pstVerb', '\code' and '\addto@pscode'. Replacing '\pstVerb' by either of the other does not give the same results. (The translation is marked with black line, as if 'rmoveto' was replaced by 'rlineto' in the '\pstVerb' variant). –  Adam B. Nov 25 '13 at 19:36
/yc exch def can be simplified as /yc ED to save more keystrokes. –  stalking is prohibited Nov 25 '13 at 19:36
@AdamB.: you do not need an own \myrmoveto. Simply use \rmoveto(0.5;90) and then \psarc[liftpen=2]{-}{.5}{90}{180}. The liftpen is important –  Herbert Nov 25 '13 at 21:22
@Herbert, yes, thank you. My Texlive on my Ubuntu 12.04 is actually outdated (pstricks v2.29). –  Adam B. Nov 25 '13 at 21:24