如何用作alpha
的角度参数\uput
?
\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
\uput[(! 1 -1)]{! alpha} ...
角度也可以由运算符前置!
。但是,使用\pcline
也是可能的,这样可以更容易地放置文本