1

I've made this exercise to find the intersection point between a line and a plane.

enter image description here

With this code:

\documentclass[9pt,handout]{beamer}
\usepackage{tkz-base}
\usepackage{pgf,tkz-euclide}
\usetkzobj{all}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\begin{frame}
\begin{center}
\begin{tikzpicture}
\tkzInit[ymax=7,xmax=9]
\tkzDefPoints{1/0/A, 6/0/B, 6/5/C, 1/5/D}
\tkzDefShiftPoint[A](30:2.5){E};
\tkzDefShiftPoint[B](30:2.5){F};
\tkzDefShiftPoint[C](30:2.5){G};
\tkzDefShiftPoint[D](30:2.5){H};

%%bepalen van lijstuk [ST]    
\tkzDefBarycentricPoint(A=1,D=2) \tkzGetPoint{K};
\tkzDrawPoints(K)
\tkzLabelPoints[left](K)
\tkzDefBarycentricPoint(E=1,F=-2.5) \tkzGetPoint{L};
\tkzDrawPoints(L)
\tkzLabelPoints[above](L)

\tkzDrawSegments(A,B B,C C,D D,A F,G G,H B,F D,H C,G K,L);
\tkzDrawSegments[dashed](A,E E,F E,H F,L);
\tkzDrawPolygon[fill=orange!40, opacity=.4](B,C,G,F);
%\tkzDrawPoints(A,B,C,D,E,F,G,H);
\tkzLabelPoints[above](C,D,G,H);
\tkzLabelPoints[below](A,B,E,F);  \pause

%%% tekenen van het hulpvlak
\tkzDrawPolygon[color=green,thick](A,D,L); \pause
\tkzDefShiftPoint[L](90:5){K};
\tkzDrawPolygon[fill=green,opacity=0.1,thick](A,D,K,L); \pause

%%% tekenen van de snijlijn
\tkzInterLL(C,G)(D,K)  \tkzGetPoint{S1};
\tkzInterLL(A,L)(B,F)  \tkzGetPoint{S2};
\tkzDrawPoint[color=red,size=8,fill=red](S1);
\tkzLabelPoint[color=red,above](S1) {S$_1$}; \pause
\tkzDrawPoint[color=red,size=8,fill=red](S2);
\tkzLabelPoint[color=red,below](S2) {S$_2$}; \pause
\tkzDrawSegment[color=red,thick](S1,S2) \pause
\tkzInterLL(S1,S2)(L,D)  \tkzGetPoint{S} %%%% <<<< this works fine, but is not correct
%\tkzInterLL(S1,S2)(L,K)  \tkzGetPoint{S} %%%% <<<< this doesn't work fine, but is correct
\tkzDrawPoint[color=red,size=10,fill=red](S)
\tkzLabelPoints[color=red,right](S) 
\end{tikzpicture}
\end{center}
\end{frame}

\end{document} 

As you can read in my code, the intersection between KL and S1S2 is not working. I've tested every other point (H,G,D,C,...) but the only thing that doesn't work is using KL. Strange enough but K and L are defined by

\tkzDefBarycentricPoint(A=1,D=2) \tkzGetPoint{K};

\tkzDefBarycentricPoint(E=1,F=-2.5) \tkzGetPoint{L};

I could define point K in a simple way, but I want to know why this is not working. (the error file says FP error: Division by zero!., makes no sense to me?)

1 Answer 1

1

The problem is that you redefine K by \tkzDefShiftPoint[L](90:5){K}; and so the lines (K,L) and (S1,S2) are parallel, so \tkzInterLL(S1,S2)(L,K) is undefined.

3
  • Great! I overlooked my code 100 times, and didn't saw the fault :-( Thanks for solving the problem after 2 years! It is still useful Commented Mar 28, 2018 at 6:13
  • 1
    I was looking for a problem of my own \tkzInterLL, so I arrived to your question 2 years later ;)
    – Kpym
    Commented Mar 28, 2018 at 6:34
  • 1
    Advise : always use \tkzDrawPoints at the end, so the points are drawn over the lines and you can see their "final" position.
    – Kpym
    Commented Mar 28, 2018 at 6:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .