![tkz-euclide 中存在错误?当点由 \tkzDefBarycentricPoint(A=1,D=2) \tkzGetPoint{K} 定义时,\tkzInterLL(S1,S2)(L,K) 不起作用](https://linux22.com/image/335538/tkz-euclide%20%E4%B8%AD%E5%AD%98%E5%9C%A8%E9%94%99%E8%AF%AF%EF%BC%9F%E5%BD%93%E7%82%B9%E7%94%B1%20%5CtkzDefBarycentricPoint(A%3D1%2CD%3D2)%20%5CtkzGetPoint%7BK%7D%20%E5%AE%9A%E4%B9%89%E6%97%B6%EF%BC%8C%5CtkzInterLL(S1%2CS2)(L%2CK)%20%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我做这个练习是为了找到线和平面之间的交点。
使用此代码:
\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}
KL
正如你在我的代码中看到的,和之间的交集S1S2
不起作用。我测试了其他所有点(H、G、D、C……),但唯一不起作用的是使用 KL。奇怪的是,K 和 L 定义为
\tkzDefBarycentricPoint(A=1,D=2) \tkzGetPoint{K};
\tkzDefBarycentricPoint(E=1,F=-2.5) \tkzGetPoint{L};
我可以K
用一种简单的方式定义点,但我想知道为什么这不起作用。(错误文件说FP error: Division by zero!.
,对我来说没有意义?)
答案1
问题在于您重新定义了K
并且\tkzDefShiftPoint[L](90:5){K};
因此线(K,L)
和(S1,S2)
是平行的,所以\tkzInterLL(S1,S2)(L,K)
未定义。