如何在 tkz-euclide 中用圆形四分之一圆和一个点标记直角?

如何在 tkz-euclide 中用圆形四分之一圆和一个点标记直角?

我目前正在重新创建这个维基百科图像:

在此处输入图片描述

来源:https://commons.wikimedia.org/wiki/File:Thaleskreis.png

我现在的图像很好,但我怀念带有点的圆形直角标记:

在此处输入图片描述

来源:https://commons.wikimedia.org/wiki/File:Triangle-thales-circle.svg

是否有可能重新定义\tkzMarkRightAngle使用其他符号(在德国学校普遍使用)。

平均能量损失

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tkz-euclide}

\begin{document}
\usetkzobj{all}
\begin{tikzpicture}
    \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]
    \tkzSetUpLine[line width=1]
    \tkzDefPoints{0/0/O, -5/0/A, 5/0/B, 5/5/M, -5/5/N}
    \tkzDefPoint(60:5){X}
    \tkzDefPoint(150:5){Y}

    \tkzDrawArc[color=black, thick, fill=gray!20](O,B)(A)

    % Avoid too long edges of polygon
    \tkzClipPolygon(A,B,M,N)
    \tkzClipCircle(O,B)

    % Draw polygons and mark right angle
    \tkzDrawPolygon[fill=red,fill opacity=0.5](A,B,X)
    \tkzMarkRightAngle(A,X,B)

    \tkzDrawPolygon[fill=blue,fill opacity=0.5](A,B,Y)
    \tkzMarkRightAngle(A,Y,B)

    % lines should not colored
    \tkzDrawPolygon(A,B,X)
    \tkzDrawPolygon(A,B,Y)

    \tkzDrawArc[color=black, thick](O,B)(A)
\end{tikzpicture}
\end{document}

答案1

您应该使用pic[draw,...]{angle=p1--p2--p3}构造而不是\tkzMarkRightAngle(p1,p2,p3)then。这可以很容易地完成,如下所示:

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tkz-euclide}
\usetikzlibrary{angles,quotes}

\begin{document}
\usetkzobj{all}
\begin{tikzpicture}[line width=1]\Large
    \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]
    \tkzSetUpLine[line width=1]
    \tkzDefPoints{0/0/O, -5/0/A, 5/0/B, 5/5/M, -5/5/N}
    \tkzDefPoint(60:5){X}
    \tkzDefPoint(150:5){Y}

    \tkzDrawArc[color=black, thick, fill=gray!20](O,B)(A)

    % Avoid too long edges of polygon
    \tkzClipPolygon(A,B,M,N)
    \tkzClipCircle(O,B)

    % Draw polygons and mark right angle
    \tkzDrawPolygon[fill=red,fill opacity=0.5](A,B,X)
    \draw pic[draw, angle radius=3mm,"$\cdot$",angle eccentricity=.6]{angle= A--X--B};

    \tkzDrawPolygon[fill=blue,fill opacity=0.5](A,B,Y)
    \draw pic[draw, angle radius=3mm,"$\cdot$",angle eccentricity=.6]{angle= A--Y--B};

    % lines should not colored
    \tkzDrawPolygon(A,B,X)
    \tkzDrawPolygon(A,B,Y)

    \tkzDrawArc[color=black, thick](O,B)(A)
\end{tikzpicture}
\end{document}

具有所需的输出:

在此处输入图片描述

答案2

这是tkz-euclide操作方法。

\tkzMarkAngle[thick,size=0.4](A,X,B)
\tkzLabelAngle[pos=0.25](A,X,B){$\cdot$}

\tkzMarkAngle[thick,size=0.4](A,Y,B)
\tkzLabelAngle[pos=0.25](A,Y,B){$\cdot$}

完整代码:

\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}

\begin{tikzpicture}
    \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]
    \tkzSetUpLine[line width=1]
    \tkzDefPoints{0/0/O, -5/0/A, 5/0/B, 5/5/M, -5/5/N}
    \tkzDefPoint(60:5){X}
    \tkzDefPoint(150:5){Y}

    \tkzDrawArc[color=black, thick, fill=gray!20](O,B)(A)

    % Avoid too long edges of polygon
    \tkzClipPolygon(A,B,M,N)
    \tkzClipCircle(O,B)

    % Draw polygons and mark right angle
    \tkzDrawPolygon[fill=red,fill opacity=0.5](A,B,X)
    \tkzMarkAngle[thick,size=0.4](A,X,B)
    \tkzLabelAngle[pos=0.25](A,X,B){$\cdot$}

    \tkzDrawPolygon[fill=blue,fill opacity=0.5](A,B,Y)
    \tkzMarkAngle[thick,size=0.4](A,Y,B)
    \tkzLabelAngle[pos=0.25](A,Y,B){$\cdot$}

    % lines should not colored
    \tkzDrawPolygon(A,B,X)
    \tkzDrawPolygon(A,B,Y)

    \tkzDrawArc[color=black, thick](O,B)(A)
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

使用新版本的 tkz-euclide这里\tkzMarkRightAngle有一个新的选项:德语

\documentclass[border=2pt]{standalone}
\usepackage{tkz-euclide}

\begin{document}
\begin{tikzpicture}
    \tkzDefPoints{0/0/O, -5/0/A, 5/0/B, 5/5/M, -5/5/N}
    \tkzDefPoint(60:5){X}
    \tkzDefPoint(150:5){Y}
    \tkzDrawArc[color=black, thick, fill=gray!20](O,B)(A)
    \tkzClipPolygon(A,B,M,N)
    \tkzClipCircle(O,B)
    \tkzDrawPolygon[fill=red,fill opacity=0.5](A,B,X)
    \tkzMarkRightAngle[german,size=.5,line width=0.8pt](A,X,B)
    \tkzDrawPolygon[fill=blue,fill opacity=0.5](A,B,Y)
    \tkzMarkRightAngle[german,size=.5,line width=0.8pt](A,Y,B)
    \tkzDrawPolygon(A,B,X)
    \tkzDrawPolygon(A,B,Y)
    \tkzDrawArc[color=black, thick](O,B)(A)
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容