I cannot find any documentation explaining how to use each of the following operators defined in pst-tools.

enter image description here

Could you give practical examples (such as simplifying vector addition

\pstVerb{/xyxyadd {3 2 roll add 3 1 roll add exch} bind def}%
\pnode(!2 60 PtoC N-A.x N-A.y xyxyadd){B}

that is equal to \nodexn{(A)+(2;60)}{B} where \pnode(2,2){A}) for each operator? I believe that the given answer will be useful for most of us.


The real scenario is to apply complex number addition to simplify method 5 and method 6 in the following answer.

  • 3
    Time for a user name change already Karl's students? :) – cmhughes Apr 15 '13 at 15:46
  • They are standard mathematical functions so it isn't really clear what kind of example you would want, If you want to plot factorial then /factorial will be useful, otherwise less so... the cx ones are just the arithmetic operations on complex numbers encoded as a pair of reals. – David Carlisle Apr 15 '13 at 16:04
  • @DavidCarlisle: For example, how to use cxadd if I want to add a point (2,2) and another point (2;60)? – kiss my armpit Apr 15 '13 at 16:06

An example of cxadd (addition of complex numbers) Just using gs on the commandline.

$ gs
GPL Ghostscript 9.04 (2011-08-05)
Copyright (C) 2011 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>[2 2] [2 60] cxadd ==
[4 62]
  • 1
    that is already shown in the above list ... ;-) – user2478 Apr 15 '13 at 16:26
  • @Herbert yes I know which is why I originally just gave a comment but OP particularly asked for this example so... – David Carlisle Apr 15 '13 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.