具有 3 个端点的三角形

具有 3 个端点的三角形

我一直在尝试寻找一个具有 3 个点的 3d 三角形,如下所示:在此处输入图片描述但我只需要 3 个点,例如 (1,0,2)、(0,-1,1) 和 (2,1,2)。该怎么做?

答案1

下面的代码不是一个完整的答案,但旨在为在 LaTeX/Tikz-3dplot 中绘制 3D 坐标提供一个起点

显示为 A2 的顶点最初显示为

\coordinate[label=above right:{$(0,0,5)$}] (A) at (0,0,5);

我只是把它改成了 A2 以满足你的要求

同样,对于标记为 A1 和 C2 的顶点——检查是否全部清除或需要更多帮助

在此处输入图片描述

% !TeX program = pdflatex
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{tikz,tikz-3dplot}

\tdplotsetmaincoords{60}{120}

\begin{document}
  \begin{tikzpicture}[>=stealth,tdplot_main_coords]
    \coordinate (O) at (0,0,0);
    \coordinate[label=above right:{A2}] (A2) at (0,0,5);
    \coordinate[label=above left:{C2}] (C2) at (2,0,2);
    \coordinate[label=above right:{$(0,3,3)$}] (C) at (0,3,3);
    \coordinate[label=above left:{A1}] (A1) at (5,0,0);
    \coordinate[label=above right:{$(0,5,0)$}] (E) at (0,5,0);

    \draw[->] (O) -- (6,0,0);
    \draw[->] (O) -- (0,6,0);
    \draw[->] (O) -- (0,0,6);

    \filldraw[draw=brown,fill=brown,fill opacity=0.1] (A2) -- (C2) -- (2,3,0) -- (C) -- cycle;
    \filldraw[draw=brown,fill=brown,fill opacity=0.1] (C2) -- (2,0,0) -- (2,3,0)-- cycle;
    \filldraw[draw=brown,fill=brown,fill opacity=0.1] (C) -- (0,3,0) -- (2,3,0)-- cycle;
    \fill[fill=blue,fill opacity=0.1] (C2) -- (A2) -- (2,3,0)-- cycle;
    \fill[fill=blue,fill opacity=0.1] (C) -- (E) -- (2,3,0)-- cycle;
    \draw[blue] (C2) -- (A1) -- (E) -- (C);
  \end{tikzpicture}
\end{document}

礼貌 - https://www.latex4technics.com/?note=5qq

编辑

符合@Sebastiano 的建议

颜色填充

已经完成并且@Sigur

独立

已部署

在此处输入图片描述

\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz,tikz-3dplot}

\tdplotsetmaincoords{60}{120}

\begin{document}
  \begin{tikzpicture}[>=stealth,tdplot_main_coords]
    \coordinate (O) at (0,0,0);
    \coordinate[label=above right:{$(0,0,5)$}] (A) at (0,0,5);
    \coordinate[label=above left:{$(2,0,2)$}] (B) at (2,0,2);
    \coordinate[label=above right:{$(0,3,3)$}] (C) at (0,3,3);
    \coordinate[label=above left:{$(5,0,0)$}] (D) at (5,0,0);
    \coordinate[label=above right:{$(0,5,0)$}] (E) at (0,5,0);

    \draw[->] (O) -- (6,0,0);
    \draw[->] (O) -- (0,6,0);
    \draw[->] (O) -- (0,0,6);

    \filldraw[draw=brown,fill=brown,fill opacity=0.3] (A) -- (B) -- (2,3,0) -- (C) -- cycle;
    \filldraw[draw=blue,fill=blue,fill opacity=0.5] (B) -- (2,0,0) -- (2,3,0)-- cycle;
    \filldraw[draw=red,fill=red,fill opacity=0.5] (C) -- (0,3,0) -- (2,3,0)-- cycle;
    \filldraw[draw=blue,fill=blue,fill opacity=0.3] (B) -- (D) -- (2,3,0)-- cycle;
    \filldraw[draw=red,fill=red,fill opacity=0.3] (C) -- (E) -- (2,3,0)-- cycle;

  \end{tikzpicture}
\end{document}

编辑

给三角形增加了一点对称性——A'--B'--C'--D'--E' 分别是三角形边的中点

在此处输入图片描述

\documentclass{standalone}
\usepackage[T1]{fontenc}
\usepackage{tikz,tikz-3dplot}
\usepackage{calc}
\tdplotsetmaincoords{60}{120}

\begin{document}
  \begin{tikzpicture}[>=stealth,tdplot_main_coords]
    \coordinate (O) at (0,0,0);
    \coordinate[label=above right:{$(0,0,5)$}] (A) at (0,0,5);
    \coordinate[label=above left:{$(5,0,0)$}] (D) at (5,0,0);
    \coordinate[label=above right:{$(0,5,0)$}] (E) at (0,5,0);
    \coordinate[label=above right:{$(0,0,0)$}] (O) at (0,0,0);


    \draw[->] (O) -- (6,0,0);
    \draw[->] (O) -- (0,6,0);
    \draw[->] (O) -- (0,0,6);

    \filldraw[draw=red,fill=red, fill opacity=0.1] (A)--(D)--(E)--cycle;
    \coordinate[label=above right:$A’$] (Aprime) at ($(A)!0.5!(E)$);
    \coordinate[label=above left:$B’$] (Bprime) at ($(A)!0.5!(D)$);
    \coordinate[label=below right:$C’$] (Cprime) at ($(D)!0.5!(E)$);
    \coordinate[label=above left:$D’$] (Dprime) at ($(O)!0.5!(D)$);
    \coordinate[label=above right:$E’$] (Eprime) at ($(O)!0.5!(E)$);


    \filldraw[draw=red, fill=red,fill opacity=.5] (Bprime)--(Dprime)--(Cprime)--cycle;
    \filldraw[draw=blue, fill=blue,fill opacity=.5] (Aprime)--(Eprime)--(Cprime)--cycle;

  \end{tikzpicture}
\end{document}

相关内容