使用`TikZ`中的`calc`包制作直角标记

使用`TikZ`中的`calc`包制作直角标记

我有一个直角三角形,并从其直角顶点画出高。A=(-4,0)B=(0,3)C=(0,0)是三角形的顶点,F=(-36/25,48/25)是斜边上的高线的底边AB。 我使用以下命令绘制直角标记。

\coordinate (U) at ($(F)!3mm!45:(A)$);
\draw ($(A)!(U)!(F)$) -- (U) -- ($(C)!(U)!(F)$);

为什么它看起来不像有边长的正方形的三边3mm

\documentclass{amsart}
\usepackage{amsmath}

\usepackage{tikz}
\usetikzlibrary{calc,intersections}


\begin{document}

\begin{tikzpicture}

\coordinate (circle_1) at (-8/5, 4/5);
\draw[blue, fill=blue=25!] (circle_1) circle (4/5);

\coordinate (circle_1) at (-3/5, 9/5);
\draw[orange, fill=orange=25!] (circle_1) circle (3/5);


\path (-4,0) coordinate (A) (0,3) coordinate (B) (0,0) coordinate (C);
\coordinate (F) at (-36/25,48/25);
\draw (A) -- (B) -- (C) -- cycle;
\draw (F) -- (C);



%A right-angle mark is drawn at F.
\coordinate (U) at ($(F)!3mm!45:(A)$);
\draw ($(A)!(U)!(F)$) -- (U) -- ($(C)!(U)!(F)$);


%A right-angle mark is drawn at C.
\coordinate (U) at ($(C)!3mm!-45:(A)$);
\draw ($(A)!(U)!(C)$) -- (U) -- ($(B)!(U)!(C)$);


\end{tikzpicture}


\end{document}

答案1

这是一个与不准确性有关的问题\pgfpintnormalised,如这个很好的答案。您的问题与上述问题完全相同这里. 当人们用更直接的方法绘制事物时,这些问题不会出现。

\documentclass{amsart}
\usepackage{amsmath}

\usepackage{tikz}
\usetikzlibrary{calc}


\begin{document}

\begin{tikzpicture}

\coordinate (circle_1) at (-8/5, 4/5);
\draw[blue, fill=blue=25!] (circle_1) circle (4/5);

\coordinate (circle_1) at (-3/5, 9/5);
\draw[orange, fill=orange=25!] (circle_1) circle (3/5);


\path (-4,0) coordinate (A) (0,3) coordinate (B) (0,0) coordinate (C);
\coordinate (F) at ($(A)!(C)!(B)$);
\draw (A) -- (B) -- (C) -- cycle;
\draw (F) -- (C);

%A right-angle mark is drawn at F.
\draw ($(F)!{sqrt(9/2)*1mm}!(A)$) coordinate (aux) -- 
($(aux)!{sqrt(9/2)*1mm}!90:(A)$) -- ($(F)!{sqrt(9/2)*1mm}!(C)$);
(C);

%A right-angle mark is drawn at C.
\draw ($(C)!{sqrt(9/2)*1mm}!(A)$) coordinate (aux) -- 
($(aux)!{sqrt(9/2)*1mm}!-90:(A)$) -- ($(C)!{sqrt(9/2)*1mm}!(B)$);
(C);

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容