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条回答
合肥-Renascence_5
2019-11-03 11:19
方法一:加载`angles`库 ```tex %\usetikzlibrary{angles} \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]at(0,1){$A$}; \node[right]at(3,2){$B$}; \node[below]at(2.5,0){$C$}; \node[above]at($(a)!(c)!(b)$){$D$}; \draw pic[draw,scale=0.2]{right angle =b--e--c};%%绘制直角 \end{tikzpicture} ``` 方法二 用`tkz-euclide`包的`angles`库 ```tex %\usepackage{tkz-euclide} %\usetkzobj{angles} \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]at(0,1){$A$}; \node[right]at(3,2){$B$}; \node[below]at(2.5,0){$C$}; \node[above]at($(a)!(c)!(b)$){$D$}; \tkzMarkRightAngle[scale=0.4](b,e,c)%%绘制直角 \end{tikzpicture} ```

一周热门 更多>