在三维中表示直角

在三维中表示直角

以下 MWE 显示了一张折叠的纸。我想通过在 M 处添加一个简单的正方形来表明虚线之间的角度是直角,这样正方形的缺失边缘与 MD 和 MD2 平行。

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[z={(0,1)},y={(1,0.6)},x={(3,-1)}]
    \coordinate (A) at (0,2);   
    \coordinate (B) at (3,2);   
    \coordinate (C) at (3,0);   
    \coordinate (M) at (0.92,1.38);
    \coordinate (D) at (1.85,2.77);

    \draw[fill=white] (A)node{A}--(B)node{B}--(C)node{C}--cycle;

    \path (M) ++(0,0,2.3) coordinate (D2);
    \draw[fill=white,opacity=0.8](A)--(D2)--(C);

    \draw[dashed](D2)node{D2}--(M)node{M}--(D)node{D};

    \end{tikzpicture}

\end{document}

在此处输入图片描述

答案1

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand{\RightAngle}[4][5pt]{%
        \draw ($#3!#1!#2$)
        --($ #3!2!($($#3!#1!#2$)!.5!($#3!#1!#4$)$) $)
        --($#3!#1!#4$) ;
        }

\begin{document}

\begin{tikzpicture}[z={(0,1)},y={(1,0.6)},x={(3,-1)}]
    \coordinate (A) at (0,2);
    \coordinate (B) at (3,2);
    \coordinate (C) at (3,0);
    \coordinate (M) at (0.92,1.38);
    \coordinate (D) at (1.85,2.77);

    \draw[fill=white] (A)node[left]{A}--(B)node[right]{B}--(C)node[below]{C}--cycle;

    \path (M) ++(0,0,2.3) coordinate (D2);
    \draw[fill=white,opacity=0.8](A)--(D2)--(C);

    \draw[dashed]
        (D2)node[above]{D2}--
        (M)node[left]{M}node[coordinate,pos=0.85](Mu){}--
        (D)node[right]{D}node[coordinate,pos=0.1](Md){};

    \RightAngle{(D2)}{(M)}{(D)}; 
    \RightAngle{(C)}{(B)}{(A)}; 
    \RightAngle{(M)}{(D2)}{(C)}; 
    \end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

您可以定义一个坐标并绘制直角符号:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[z={(0,1)},y={(1,0.6)},x={(3,-1)}]
    \coordinate (A) at (0,2);
    \coordinate (B) at (3,2);
    \coordinate (C) at (3,0);
    \coordinate (M) at (0.92,1.38);
    \coordinate (D) at (1.85,2.77);

    \draw[fill=white] (A)node[left]{A}--(B)node[right]{B}--(C)node[below]{C}--cycle;

    \path (M) ++(0,0,2.3) coordinate (D2);
    \draw[fill=white,opacity=0.8](A)--(D2)--(C);

    \draw[dashed](D2)node[above]{D2}--(M)node[left]{M}node[coordinate,pos=0.85](Mu){}--(D)node[right]{D}
                                                node[coordinate,pos=0.1](Md){};
    \node[coordinate] (Muu) at (Mu-|Md) {};
    \draw ([yshift=-0.5]Mu) -- (Muu) -- (Md);       %%% here and coordinates in above line.
    \end{tikzpicture}

\end{document}

在此处输入图片描述

PS:为了更清楚起见,我还改变了其他节点的位置。

答案3

如果我理解正确的话,直角可以使用tkz-euclide包来定义:

\documentclass{article}
\usepackage{tikz,tkz-euclide}
\usetkzobj{all}

    \begin{document}

    \begin{tikzpicture}[z={(0,1)},y={(1,0.6)},x={(3,-1)}]
        \coordinate (A) at (0,2);   
        \coordinate (B) at (3,2);   
        \coordinate (C) at (3,0);   
        \coordinate (M) at (0.92,1.38);
        \coordinate (D) at (1.85,2.77);

        \draw[fill=white] (A)node{A}--(B)node{B}--(C)node{C}--cycle;

        \path (M) ++(0,0,2.3) coordinate (D2);
        \draw[fill=white,opacity=0.8](A)--(D2)--(C);

        \draw[dashed](D2)node{D2}--(M)node [left] {M}--(D)node{D};

       \tkzMarkRightAngle(D2,M,D);

         \end{tikzpicture}

    \end{document}

在此处输入图片描述

相关内容