如何在 tkz-euclide 的延长线上标记直角?

如何在 tkz-euclide 的延长线上标记直角?
\documentclass{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\coordinate (u) at (-2,-2);
\coordinate (v) at (9,8);
\clip  (u) rectangle (v);
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDrawPolygon(A,B,C) 
\tkzLabelSegment[below](A,B){$  $}
\tkzLabelSegment[above left](A,C){$  $}
\tkzLabelSegment[above right](B,C){$  $}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzMarkRightAngle(A,F,C)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

将点“A”绕“F”旋转 90 度,并将其称为“H” \tkzDefPointBy[rotation in rad= center F angle pi/2](A)\tkzGetPoint{H}。现在您可以标记它。

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

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\coordinate (u) at (-2,-2);
\coordinate (v) at (9,8);
\clip  (u) rectangle (v);
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDrawPolygon(A,B,C) 
\tkzLabelSegment[below](A,B){$  $}
\tkzLabelSegment[above left](A,C){$  $}
\tkzLabelSegment[above right](B,C){$  $}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzMarkRightAngle(A,F,C)
\tkzDefPointBy[rotation in rad= center F angle pi/2](A)\tkzGetPoint{H}
\tkzMarkRightAngle(B,F,H)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

我认为最好使用 的最新版本tkz-euclide。实际上 CTAN 上的是 3.05。

上一个版本有几种解决方案。在新版本中,最简单的方法是获取 CF 线上的点。您可以使用以下方法执行此操作:

\tkzDefPointOnLine[pos=1.2](C,F) \tkzGetPoint{x} pos是 TikZ 的选项

一些备注:使用 3.05 版本时您不需要%\usetkzobj{all},您不需要剪切矩形来控制边界框。

您还有其他解决方案:例如“tkzDefPointWith[orthogonal ... '

\documentclass{standalone}
\usepackage{tkz-euclide}
%\usetkzobj{all} % you don't need this line with the last version 3.05

\begin{document}
\begin{tikzpicture}
\pgfmathsetmacro{\a}{8} % BC
\pgfmathsetmacro{\b}{7} % AC
\pgfmathsetmacro{\c}{6} % AB
\tkzDefPoints{0/0/A,\c/0/B}
\tkzInterCC[R](A,\b cm)(B,\a cm) \tkzGetFirstPoint{C}
\tkzDefPointBy[projection=onto A--B](C)\tkzGetPoint{F}
\tkzDefPointBy[projection=onto B--C](A)\tkzGetPoint{D}
\tkzDefPointBy[projection=onto A--C](B)\tkzGetPoint{E}
\tkzDefPointOnLine[pos=1.2](C,F) \tkzGetPoint{x}

\tkzDrawLine[add = 0 and 0.2,densely dashed](B,E)
\tkzDrawLine[add = 0 and 0.2,densely dashed](C,F)
\tkzDrawLine[add = 0 and 0.2,densely dashed](A,D)

\tkzDrawPolygon(A,B,C) 
\tkzLabelSegment[below](A,B){$  $}
\tkzLabelSegment[above left](A,C){$  $}
\tkzLabelSegment[above right](B,C){$  $}
\tkzLabelPoints[left,yshift=-2pt](A)
\tkzLabelPoints[right,yshift=-2pt](B)
\tkzLabelPoints[above](C)

\tkzMarkRightAngle(A,F,C)
\tkzMarkRightAngle(x,F,B)
\end{tikzpicture}
\end{document}

在此处输入图片描述

这是获取点 E、D、F 的另一种解决方案,这里是 H_A H_B 和 H_C。我向您展示如何获取点 a(在 ABC 之外)

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

\begin{document}  
\begin{tikzpicture}[scale=1]
    \tkzDefPoints{1/5/A,0/0/B,7/0/C}
  \tkzDefSpcTriangle[orthic](A,B,C){H_A,H_B,H_C}
  \tkzOrthoCenter(A,B,C)  \tkzGetPoint{H}
  \tkzDrawPolygon[red](A,B,C)
  \tkzDrawSegments(A,H_A B,H_B C,H_C)

  \tkzLabelPoints[red](C)
  \tkzLabelPoints[left,red](B)
  \tkzLabelPoints[red,above](A)
  \tkzMarkRightAngles[fill=gray!20,opacity=.5](A,H_A,C B,H_B,A C,H_C,A)
  \tkzDrawPoints[red](A,B,C)
  \tkzDrawPoints[blue](H_A,H_B,H_C)
  \tkzDrawPolygon[red,fill=red!20,opacity=.3](A,B,C)
  \tkzDrawPolygon[blue,fill=blue!20,opacity=.3](H_A,H_B,H_C)
  \tkzLabelPoints[blue](H_A)
  \tkzLabelPoints[blue,above left](H_C)
  \tkzLabelPoints[blue,above right](H_B)
  \tkzDefPointWith[orthogonal,normed](H_A,B) \tkzGetPoint{a}
  \tkzDrawPoint(a)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

只是为了好玩!

import psteuclasy; //https://github.com/justonly011298/test-tkz-euclide
size(300);
unitsize(1cm);
real a=8,b=7,c=6;
pair A=(0,0),B=(c,0), C=pstInterCC(A,b,B,a)[1];
pair F=pstProjection(A,B,C),D=pstProjection(B,C,A),E=pstProjection(A,C,B);

pstRightAngle(C,F,A);
pstRightAngle(pstRotation(90,F,A),F,B);
draw(A--B--C--cycle);
draw(pstLineAB(C,F,0,-1)^^pstLineAB(A,D,0,-1)^^pstLineAB(B,E,0,-1),dashed);

dot("$A$",A,dir(-135),Fill(white));
dot("$B$",B,dir(-45),Fill(white));
dot("$C$",C,dir(90),Fill(white));

在此处输入图片描述

相关内容