I have a right triangle and the altitude from the vertex of its right angle drawn. A=(-4,0), B=(0,3), and C=(0,0) are the vertices of the triangle, and F=(-36/25,48/25) is the foot of the altitude on the hypotenuse AB. I use the following commands to draw a right-angle mark.
\coordinate (U) at ($(F)!3mm!45:(A)$);
\draw ($(A)!(U)!(F)$) -- (U) -- ($(C)!(U)!(F)$);
Why doesn't it look like three sides of a square with edge length 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}
