# Why does \tkzInterLC calculate the wrong radius?

The following description of a triangle is given:

Let Δ ABC be a right angle triangle. With ∠ABC=90, AB=12cm, AC=15cm. The point D lies on AB such that DB = 7cm. The last point E lies on AC such that ∠DEA = 90.

I am trying to draw the triangle only using the information above. Meaning I do not want to use Pythagoras to calculate AB = sqrt(AC^2 - BC^2) = 9.

The restrictions above led me to use tkz-euclide. In particular the lines

    \tkzDefLine[orthogonal=through B](A,B) \tkzGetPoint{b}
\tkzInterLC[R](B,b)(A,\AC cm) \tkzGetPoint{C}


Seemed promising in defining where the point C should lie. In short we define a line orthogonal to AB through B (Since the angle ABC = 90^c), then intersect this line with a circle with center in A and radius 15. See the figure below.

Here the blue triangle is the correct one, while the bigger one is the one defined through the command above. The numbers shows the radius, so the circle is too big 16.9>15.00 using the command above. However, the correct result is obtained using

    \tkzDefLine[orthogonal=through B](A,B) \tkzGetPoint{b}
\tkzInterLC[R](B,b)(A,\AC cm) \tkzGetPoints{C}{C2}


or

    \tkzDefLine[orthogonal=through B](A,B) \tkzGetPoint{b}
\tkzInterLC[R](B,b)(A,\AC cm) \tkzGetFirstPoint{C}


What is the difference? And what is the problem with using \tkzGetPoint?

\documentclass{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}

\begin{tikzpicture}
\tkzInit[xmin=-0.4,xmax=12.45,ymin=-0.5,ymax = 12.5]
\tkzClip

\def\scale{1}
\pgfmathsetmacro{\AB}{\scale*12}
\pgfmathsetmacro{\AC}{\scale*15}
\pgfmathsetmacro{\BC}{sqrt(\AC*\AC-\AB*\AB)}
\pgfmathsetmacro{\BD}{\scale*7}

\tkzDefPoint(0,0){A}
\tkzDefPoint(\AB,0){B}

\tkzDefLine[orthogonal=through B](A,B) \tkzGetPoint{b}
\tkzInterLC[R](B,b)(A,\AC cm) \tkzGetPoint{C}
\tkzCalcLength[cm](A,C)\tkzGetLength{rAC}

\tkzDefPoint(\AB,\BC){CC}
\tkzCalcLength[cm](A,CC)\tkzGetLength{rACC}
\tkzDefPoint(\AB-\BD,0){D}

\tkzDefLine[orthogonal=through D](A,C) % \tkzGetPoint{d}
\tkzInterLL(A,C)(D,tkzPointResult) \tkzGetPoint{E}

\tkzMarkRightAngle(D,E,A)
\tkzMarkRightAngle(A,B,C)
\tkzDrawSegment(D,E)
\tkzDrawPolygon(A,B,C)
\tkzDrawPolygon[blue](A,B,CC)

\tkzLabelPoint[below left](A){$A$}
\tkzLabelPoint[below right](B){$B$}
\tkzLabelPoint[above right](C){$C$}
\tkzLabelPoint[below](D){\rACC}
\tkzLabelPoint[above left](E){\rAC}
\end{tikzpicture}

\end{document}


The intersection of a circle and a line defines 0,1 or two points but when you get two points it's not possible to know the order. When the first point gives a bad result, you need to take the second. It's why I defined three macros to get the two points, or only one point.

I do not use tkz-euclide so I cannot say much to your actual problem, but would like to mention that you can do things very easily here with calc and intersection "only".

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{tikzpicture}
\path (0,0) coordinate (A) (12,0) coordinate (B) (12-7,0) coordinate (D);
\begin{scope}[overlay]
\draw[red] (D) -- ($(A)!(D)!(C)$);