\documentclass[pstricks,border=20pt]{standalone}
\usepackage{pst-eucl}
\begin{document}
\begin{pspicture}(3,3)
\pstGeonode(0,0){A}(3,3){B}
\pnode([nodesep=10pt]{B}A){A'}
\pnode([nodesep=10pt]{A}B){B'}
\psline(A)(A')
\psline[linestyle=dashed,linecolor=red](A')(B')
\psline(B')(B)
\end{pspicture}
\end{document}
TikZ 中的对应词是什么?在 PSTricks 中,它表示与 相距 且位于连接和 的线上的([nodesep=10pt]{B}A)
一个点。10pt
A
A
B
答案1
您可以使用($(A)!1cm!(B)$)
沿路径移动特定距离,如第二幅图所示。第一幅图是更常见的用法,用于沿线移动一定百分比:
代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,4);
\coordinate (B) at (3,6);
\draw [thin, blue] (A) -- (B);
\node [below] at (A) {A};
\node [above] at (B) {B};
\coordinate (A') at ($(A)!0.25!(B)$);
\draw [ultra thick, red] (A) -- (A') node [above left,black] {(\$(A)!0.25!(B)\$)};
\end{tikzpicture}
\begin{tikzpicture}
\coordinate (A) at (0,4);
\coordinate (B) at (3,6);
\draw [thin, blue] (A) -- (B);
\node [below] at (A) {A};
\node [above] at (B) {B};
\coordinate (A') at ($(A)!1cm!(B)$);
\draw [ultra thick, red] (A) -- (A') node [below right,black] {(\$(A)!1cm!(B)\$)};
\end{tikzpicture}
\end{document}