使用 Tkz-Euclide-euclide 时虚线中的替代颜色

使用 Tkz-Euclide-euclide 时虚线中的替代颜色

在使用 Tikz-Euclide 时,有没有办法使第三个三角形上的线变成虚线但颜色交替,从而显示出另外两个三角形彼此重叠。

\documentclass{book}

\usepackage{blindtext}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{
    float, 
    graphicx
}
% Proposition environment
\newenvironment{proposition}
    {\begin{center}\em}
    {\end{center}}

%Diagram enviroment    
\newenvironment{diagram}
{\begin{center}\vspace*{10pt}\begin{tikzpicture}}
    {\end{tikzpicture}\vspace*{-5pt}\end{center}}

\begin{document}
\begin{diagram}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(-2,0){B}
    \tkzDefPoint(-1.5,2){C}
    \tkzDefPoint(4,0){P}
    \tkzDefPoint(2,0){Q}
    \tkzDefPoint(2.5,2){R}
        \tkzDrawPolygon[red](A,B,C)
        \tkzDrawPolygon[blue](P,Q,R)
             \tkzLabelPoints[right](A,P)
             \tkzLabelPoints[left](B,Q)
            \tkzLabelPoints[above](C,R)
                 \tkzMarkAngle[size=0.5](A,B,C)
                 \tkzMarkAngle[size=0.5](P,Q,R)
\end{diagram}

$\overline{AB} = \overline{PQ}$ given in the proposition\\
$\overline{BC} = \overline{QR}$ given in the proposition\\
$\angle{ABC} = \angle{PQR}$ given in the proposition\\

We can now superimpose  the triangles onto one another with point $A$      matched with $P$, point $B$ matched with $Q$ and $C$ matched with $R$. and and  with $\angle{ABC}$ matched with $\angle{PQR}$. we can say that the two triangles  and \textit{congruent} with each other.

\begin{diagram}


    \tkzDefPoint(0,0){A}
    \tkzDefPoint(-2,0){B}
    \tkzDefPoint(-1.5,2){C}

        \tkzDrawPolygon(A,B,C)

            \tkzLabelPoints[right](A)
            \tkzLabelPoints[left](B)
            \tkzLabelPoints[above](C)
                \tkzMarkAngle[size=0.5](A,B,C)
            
\end{diagram}


\end{document}

如果有人有其他解决方案,我不必成为 Tkz-Euclide。谢谢

答案1

我认为我已经解决了这个问题,但任何改进仍然受到欢迎

    \documentclass{book}    

    \usepackage{blindtext}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{
    float, 
    graphicx
}
% Proposition environment
\newenvironment{proposition}
    {\begin{center}\em}
    {\end{center}}

%Diagram enviroment    
\newenvironment{diagram}
{\begin{center}\vspace*{10pt}\begin{tikzpicture}}
    {\end{tikzpicture}\vspace*{-5pt}\end{center}}

\begin{document}
\begin{diagram}
    \tkzDefPoint(0,0){A}
    \tkzDefPoint(-2,0){B}
    \tkzDefPoint(-1.5,2){C}
    \tkzDefPoint(4,0){P}
    \tkzDefPoint(2,0){Q}
    \tkzDefPoint(2.5,2){R}
        \tkzDrawPolygon[red](A,B,C)
        \tkzDrawPolygon[blue](P,Q,R)
             \tkzLabelPoints[right](A,P)
             \tkzLabelPoints[left](B,Q)
            \tkzLabelPoints[above](C,R)
                 \tkzMarkAngle[size=0.5](A,B,C)
                 \tkzMarkAngle[size=0.5](P,Q,R)
    \end{diagram}

$\overline{AB} = \overline{PQ}$ given in the proposition\\
$\overline{BC} = \overline{QR}$ given in the proposition\\
$\angle{ABC} = \angle{PQR}$ given in the proposition\\

We can now superimpose  the triangles onto one another with  point $A$      matched with $P$, point $B$ matched with $Q$ and $C$  matched with $R$. and and  with $\angle{ABC}$ matched with  $\angle{PQR}$. we can say that the two triangles  and      \textit{congruent} with each other.

\begin{diagram}


    \tkzDefPoint(0,0){A}
    \tkzDefPoint(-2,0){B}
    \tkzDefPoint(-1.5,2){C}

        \tkzDrawPolygon[red, dash pattern= on 3pt off 5pt](A,B,C) %-------Added
        \tkzDrawPolygons[blue, dash pattern = 0n 3pt off 5pt,dash phase=4pt](A,B,C)%--------Added

            \tkzLabelPoints[right](A)
            \tkzLabelPoints[left](B)
            \tkzLabelPoints[above](C)
            \tkzMarkAngle[size=0.5](A,B,C)
        
\end{diagram}


\end{document}

相关内容