tikz过一点作一直线的垂线,怎么在交点处(D点的位置)添加垂足符号呢?

2019-11-03 11:03发布

\begin{tikzpicture} \draw[help lines](0,0)grid(3,2); \coordinate(a)at(0,1); \coordinate(b)at(3,2); \...

\begin{tikzpicture}
\draw[help lines](0,0)grid(3,2);
\coordinate(a)at(0,1);
\coordinate(b)at(3,2);
\coordinate(c)at(2.5,0);
\coordinate(e)at($(a)!(c)!(b)$);
\draw[blue](c)--($(a)!(c)!(b)$);
\node[left](a)at(0,1){$A$};
\node[right](b)at(3,2){$B$};
\node[below](c)at(2.5,0){$C$};
\node[above](d)at($(a)!(c)!(b)$){$D$};
\end{tikzpicture}
2条回答
咸菜的味道
2019-11-04 10:36
一个偷懒不嫌麻烦的办法,用 turn 选项: ```tex \begin{tikzpicture} \draw[help lines](0,0)grid(3,2); \coordinate(a)at(0,1); \coordinate(b)at(3,2); \coordinate(c)at(2.5,0); \coordinate(d)at($(a)!(c)!(b)$); \path(c)--(d) -- ([turn]90:2mm) coordinate (t1) -- ([turn]90:2mm) coordinate (t2) -- ([turn]90:2mm) coordinate (t3); \draw[blue](c)--(d); \draw[red](t1)--(t2)--(t3); \node[left](A)at(0,1){$A$}; \node[right](B)at(3,2){$B$}; \node[below](C)at(2.5,0){$C$}; \node[above](D)at(d){$D$}; \end{tikzpicture} ```

一周热门 更多>