You probably know that if you draw all three altitudes of a triangle, they will meet at a single point, the orthocenter.
I'm trying to draw a picture that shows the intersecting altitudes with TikZ and letting TikZ do most of the job for me. I'm using TikZ's coordinate calculation capabilities for that.
Here is the code:
\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[scale=2]
\coordinate (A) at (0,0);
\coordinate (B) at (1,2.5);
\coordinate (C) at (4,0);
\draw (A) -- (B) -- (C) -- cycle;
\draw (B) -- ($(A)!(B)!(C)$) ++(90:0.2) -- ++(0:0.2) -- +(-90:0.2);
\draw (A) -- ($(B)!(A)!(C)$) ++(-39.806:0.2) -- ++(50.194:-0.2) -- +(-39.806:-0.2);
\draw (C) -- ($(A)!(C)!(B)$) ++(68.2:-0.2) -- ++(-21.8:0.2) -- +(68.2:0.2);
\end{tikzpicture}
\end{document}
Here is the result:

Upon very close inspection (e.g., if you view the resulting pdf file with a pdf-reader and zoom in as close as possible) you can see that the three altitudes do not meet at a single point but instead meet in pairs, producing three distinct intersections.
Here's an image of the "intersection point" at 1600%

I also tried with different line widths, i.e. I used [very thin] on the whole {tikzpicture} environment but the problem persists.
I feel the reason for this inaccuracy might be due to numeric precision to which TikZ calculations are limited. However, I am still wondering if anyone has encountered this problem or knows of a solution? Or maybe that's the wrong method to draw altitudes?
P. S. while not a very big problem it still feels disappointing to know your pictures only look correct when not zoomed in on.




scale=1. – Gonzalo Medina Jul 21 '15 at 14:57scale=1. – Rokas Jul 21 '15 at 14:59