考虑以下绕点旋转四边形的(非最小)示例:
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{xfp}
\begin{document}
\def\Ax{-1}
\def\Ay{4}
\def\Bx{-2}
\def\By{3}
\def\Cx{-1}
\def\Cy{1}
\def\Dx{0}
\def\Dy{3}
\def\Ex{1}
\def\Ey{2}
\def\rotation{90}
\def\punkt(#1){%
\def\str{0.1}
\rput(#1){%
\psline(-\str,-\str)(\str,\str)
\psline(-\str,\str)(\str,-\str)}
\uput[45](#1){$#1$}}%
\begin{pspicture}(-2.45,-1.12)(2.05,4.4)
\pnodes(\Ax,\Ay){A}(\Bx,\By){B}(\Cx,\Cy){C}(\Dx,\Dy){D}(\Ex,\Ey){E}
{\psset{
linewidth = 1.5\pslinewidth,
fillstyle = solid,
fillcolor = cyan!50
}
\pspolygon(A)(B)(C)(D)
\psrotate(E){\rotation}{%
\pspolygon[
linecolor = red
](\Ax,\Ay)(\Bx,\By)(\Cx,\Cy)(\Dx,\Dy)
\uput[180]{\fpeval{360-\rotation}}(\Ax,\Ay){$A'$}
\uput[270]{\fpeval{360-\rotation}}(\Bx,\By){$B'$}
\uput[90]{\fpeval{360-\rotation}}(\Cx,\Cy){$C'$}
\uput[90]{\fpeval{360-\rotation}}(\Dx,\Dy){$D'$}}}
\uput[90](A){$A$}
\uput[180](B){$B$}
\uput[270](C){$C$}
\uput[0](D){$D$}
\punkt(E)
\end{pspicture}
\end{document}
节点A'
--D'
没有按照我预期的位置放置;我希望A'
将其放置在顶点的左侧A
、B'
顶点的下方B
,等等。
我如何实现这个目标?
答案1
诀窍(!!)是不要忘记用于放置标签方向的极轴也进行了旋转。因此:
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\begin{document}
\def\Ax{-1}
\def\Ay{4}
\def\Bx{-2}
\def\By{3}
\def\Cx{-1}
\def\Cy{1}
\def\Dx{0}
\def\Dy{3}
\def\Ex{1}
\def\Ey{2}
\def\rotation{90}
\def\punkt(#1){%
\def\str{0.1}
\rput(#1){%
\psline(-\str,-\str)(\str,\str)
\psline(-\str,\str)(\str,-\str)}
\uput[45](#1){$#1$}}%
\begin{pspicture}(-2.45,-1.12)(2.05,4.4)
\pnodes(\Ax,\Ay){A}(\Bx,\By){B}(\Cx,\Cy){C}(\Dx,\Dy){D}(\Ex,\Ey){E}
{\psset{
linewidth = 1.5\pslinewidth,
fillstyle = solid,
fillcolor = cyan!50
}
\pspolygon(A)(B)(C)(D)
\psrotate(E){\rotation}{%
\pspolygon[
linecolor = red
](\Ax,\Ay)(\Bx,\By)(\Cx,\Cy)(\Dx,\Dy)
\uput[90]{-\rotation}(\Ax,\Ay){$A'$}
\uput[180]{-\rotation}(\Bx,\By){$B'$}
\uput[-90]{-\rotation}(\Cx,\Cy){$C'$}
\uput[0]{-\rotation}(\Dx,\Dy){$D'$}}}
\uput[90](A){$A$}
\uput[180](B){$B$}
\uput[270](C){$C$}
\uput[0](D){$D$}
\punkt(E)
\end{pspicture}
\end{document}
答案2
\uput[180]{E}(\Ax,\Ay){$A'$}
\uput[270]{E}(\Bx,\By){$B'$}
\uput[0]{E}(\Cx,\Cy){$C'$}
\uput[90]{E}(\Dx,\Dy){$D'$}}}