3

How to use alpha as the angle arguments of \uput?

enter image description here

\documentclass[border=0pt]{standalone}
\usepackage{pstricks-add}

\pstVerb{
    /theta 45 def
    /alpha theta 90 sub def
    /weight 1.5 def
}

\begin{document}
\begin{pspicture}(-2.2,-2.2)(2.5,2.5)
    \psaxes[ticks=none,labels=none,linestyle=dashed]{->}(0,0)(-2,-2)(2,2)[$x$,0][$y$,90]
  \psframe*[linecolor=gray,opacity=0.5](-1,-0.5)(1,0.5)
  \psline{->}(!alpha dup cos weight mul exch sin weight mul)
  %---------------------------------------------------------
  \uput[(!1 -1)]{(!1 dup)}% how to use alpha here?
    (!alpha dup cos weight mul exch sin weight mul){$\vec{w}$} 
\end{pspicture}
\end{document}

1 Answer 1

3
\uput[(! 1 -1)]{! alpha} ... 

angles can also be preceeded by a ! operator. However, using \pcline is also possible, then it is easier to place the text

2
  • But labelsep in uput cannot be in RPN. For example: \uput{!2 sqrt}[45](0,0){A} does not produce the expected result. Commented Apr 12, 2013 at 8:21
  • My above comment has been solved. Commented Aug 30, 2013 at 0:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .