3

I am trying to find the intersection of (A,B) with the orthogonal line through P. The following code results in "No shape named C is known":

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

\begin{document}

\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(11,0){B}
  \tkzDefPoint(10,10){P}
  \tkzDefLine[orthogonal=through P](B,A) \tkzGetPoint{X_1}
  \tkzInterLL(P,X_1)(A,B) \tkzGetPoint(C)
  \tkzLabelPoints(C)
\end{tikzpicture}

\end{document}

and I don't understand why that intersection point should not exist.

  • Wrong braces. Use \tkzGetPoint{C} instead of \tkzGetPoint(C). – Bobyandbob Mar 08 '17 at 21:16
  • See also http://tex.stackexchange.com/questions/282879/drawing-a-perpendicular-line-with-the-package-tkz-euclide on the right in the Related-list. – Marijn Mar 08 '17 at 21:18
  • 1
    @Bobyandbob Would you put your comment as an answer, which can be accepted so this question can then disappear from the unanswered queue? – jjdb May 05 '17 at 10:43

1 Answers1

4

You only have to use \tkzGetPoint{C} instead of \tkzGetPoint(C). Syntax change.

I also added (drawing) the points and lines with \tkzDrawPoints(C,X_1) and \tkzDrawLine(A,B) to visualize the solution. \tkzLabelPoints(A,B) plots the label.

Define a orthogonal line to a other line (A,B) going through a Ponit P: Therefore you can use \tkzDefLine[orthogonal=through P](B,A), the second point of the line you can get with \tkzGetPoint{X_1}(first point is P) defined as X_1.

Compute the intersection of two line:
\tkzInterLL(P,X_1)(A,B): computes the intersection of the two lines (P,X_1) and (A,B). With \tkzGetPoint{C} you get the intersection point, saved as C.

Solution:

enter image description here

MWE:

\documentclass{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
  \tkzDefPoint(0,0){A}
  \tkzDefPoint(11,0){B}
  \tkzDefPoint(10,10){P}
  \tkzDrawPoints(A,B,P)\tkzLabelPoints(A,B,P)
  %
  \tkzDefLine[orthogonal=through P](B,A)     
  \tkzGetPoint{X_1}
  %  
  \tkzInterLL(P,X_1)(A,B)
  \tkzGetPoint{C}
  \tkzDrawPoints(C,X_1)\tkzLabelPoints(C,X_1)
  %
   \tkzDrawLine(A,B)
   \tkzDrawLine(P,X_1)
\end{tikzpicture}
\end{document}
Bobyandbob
  • 4,899