[pstricks] Ending a psline on pscircle

Luis Sequeira lfsequeira at gmail.com
Wed Feb 12 21:03:23 CET 2014

>> I suppose you are looking for something like that
> Herbert,
>   I'll need to play with your code to understand how to use it well.
>   Yesterday's figure is what prompted me to write (code modified from what
> worked in previous figures; probably not optimum):
> \documentclass[12pt,letterpaper]{article}
> \usepackage{pstricks-add,graphicx}
> \usepackage[margin=1cm]{geometry}
> \newsavebox\PSTBox
> \begin{document}
>   \psset{framesep=2mm,arrowscale=1.75}
>   %\begin{pspicture}[showgrid](-1.0,-0.25)(15,15)
>   \begin{pspicture}(-1.0,-0.25)(15,15)
>     \pscircle(5,5){4.7cm}
>     \pscircle(10.5,5){4.0cm}
>     \psline[linewidth=3pt](5,5)(10.5,5)
>     \psline[linewidth=3pt](5,5.25)(5,4.75)
>     \psline[linewidth=3pt](10.5,5.25)(10.5,4.75)
>     \psline{->}(5,5)(2.18,1.18)
>     \psline{->}(10.5,5)(12.68,1.6)
>     \psline{->}(8.3,8.3)(8.3,5)
>     \rput(5,5.6){2006}
>     \rput(10.5,5.6){2005}
>     \rput(8.3,4.5){2004}
>     \rput(2.6,3.7){Circle with}
>     \rput(2.6,3.2){radius 47}
>     \rput(12.75,3.7){Circle with}
>     \rput(12.75,3.2){radius 40}
>   \end{pspicture}
> \end{document}

For the two radii, the polar coordinates are the good answer.
Like Werner wrote, you need to enter the \SpecialCoor command somewhere in the pspicture environment, and then your radii can be just writen very easily with polar coordinates:

    \psline[origin={5,5}]{->}(4.7;240) %polar coordinates: radius & angle, separated by ‘;’

(Note the setting of origin at the center of each circle; this makes the coordinates of the line end relative to the center; that is what makes polar coordinates so simple)

The last one (the vertical line) is trickier, and you need a little calculation, though it is basic algebra.
Your value of 8.3 is not far (8.303636363…) and from there you can find the y coordinate with the Pythagorean theorem, giving 8.34305...

Luis Sequeira

More information about the PSTricks mailing list