如何在边上添加符号来表示它们的长度相同?

如何在边上添加符号来表示它们的长度相同?

有些边的长度相同。我想在上面添加一些小符号,如图所示:

DA、DB、DC 处长度相同

我该怎么办?谢谢。

\begin{tikzpicture}      
\coordinate (Base1) at (0,0);
\coordinate (Base2) at (4,0);
\coordinate (Base3) at (5,2);
\coordinate (TopPt) at (2,5);
\draw [draw=black, every edge/.append style={draw=black, dashed}]
     (Base1) -- (Base2) --(Base3) 
     (Base3) edge (Base1);
\draw [draw=black, every edge/.append style={draw=black, dashed}]
     (TopPt) -- (Base1) 
     (TopPt) -- (Base2) 
     (TopPt) -- (Base3);
\end{tikzpicture}

答案1

您可以使用 将节点放置在线上,并使其与线的斜率对齐sloped。对于双线,我使用了\parallel符号。如果不喜欢符号与线正交,可以通过rotate=<angle>向节点添加来增加一些轻微的倾斜。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
\coordinate (Base1) at (0,0);
\coordinate (Base2) at (4,0);
\coordinate (Base3) at (5,2);
\coordinate (TopPt) at (2,5);
\draw [draw=black, every edge/.append style={draw=black, dashed}]
     (Base1) -- (Base2) -- (Base3) 
     (Base3) edge (Base1);
\draw [draw=black, every edge/.append style={draw=black, dashed}]
     (TopPt) -- node[sloped] {$\parallel$} (Base1) 
     (TopPt) -- node[sloped] {$\parallel$} (Base2) 
     (TopPt) -- node[sloped] {$\parallel$} (Base3);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容