绘图(x、y、z 轴)

绘图(x、y、z 轴)

我对此有些问题。我需要绘制 x、y 和 z 轴,然后绘制这个 3d 图形。在网上我没有找到类似的东西(示例等)。我需要一些可以帮助我完成这项任务的提示或链接。谢谢。

在此处输入图片描述

答案1

tikz-3dplot可以执行以下操作。

\documentclass[border=2mm,tikz]{standalone} 
\usepackage{tikz-3dplot} 
\begin{document} 
\tdplotsetmaincoords{70}{105} 
\begin{tikzpicture}[tdplot_main_coords,line join=round,>=stealth,
bullet/.style={circle,fill,inner sep=1pt}]
 \draw[->] (0,0,0) coordinate (O) -- (6,0,0) coordinate(X) node[pos=1.05] {$x$};
 \draw[->]  (O) -- (0,4,0) coordinate(Y) node[pos=1.05] {$y$};
 \draw[->]  (O) -- (0,0,4) coordinate(Z) node[pos=1.05] {$z$};
 \draw (4,0,0) coordinate(A) node[bullet,label=below right:$A$,label=left:$m$]{}
  -- (4,0,2) coordinate(D) node[bullet,label=left:$D$]{} 
  -- (0,0,2) coordinate(C) node[bullet,label=left:$C$]{} node[pos=0.75,bullet] (CD){}
  -- (0,3,2) coordinate(E) node[bullet,label=right:$E$]{}
  -- (D) node[pos=0.25,bullet] (ED){} ;
 \draw[densely dotted] (C) -- (A) node[pos=0.25,bullet] (CA){};
 \draw[thick] (E) -- (A) node[pos=0.25,bullet] (EA){};
 \draw[densely dotted] (CD) -- (CA) -- (EA);
 \draw (CD) -- (ED) -- (EA);
 \draw[dotted] (CA) -- (1,0,0) node[left]{$i$} (E) -- (0,3,0)  node[below right]{$m$};
\end{tikzpicture} 
\end{document}

在此处输入图片描述

答案2

拥有intersectionsTi 库z,你可以得到这个。

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}  
    \begin{document}

\begin{tikzpicture}[>=stealth]
    \coordinate (O) at (0,0);
    \coordinate (A) at (-135:5);
    \coordinate (E) at (4,1.5);
    \coordinate (s) at (0,1.5);
    \draw [->] (O)--++(-135:6)node[right]{$x$};
    \draw [->] (O)--++(0:5)node[right]{$y$};
    \draw [->] (O)--++(90:3)node[right]{$z$};
\path [draw, ultra thick, name path=AE] (A)node[right=1mm]{$A$}--(E)node[right]{$E$};
\draw (s)node[above right=1mm]{$C$}--(E);
\draw (A)--++(90:1.5)coordinate(D);
\path [draw,name path=DE] (D)--(E);
\path [draw,name path=Ds] (D)node[above left]{$D$}--(s);
\path [draw,densely dotted,name path=As](A)--(s)node[left]{$s$};
\path [name path=ls](-0.75,4)--(-0.75,-4);
\path [name path=rs](2.5,4)--(2.5,-4);
\path [name intersections={of=ls and Ds, by={1}}];
\path [name intersections={of=ls and As, by={2}}];
\path [name intersections={of=rs and DE, by={3}}];
\path [name intersections={of=rs and AE, by={4}}];
\draw (2)--(1)--(3)--(4);
\draw [densely dotted] (2)--(4);
\foreach \t in {1,2,3,4,A,E,s,O,D}{
\filldraw (\t) circle (1.5pt);}
\draw [densely dotted](E)--(4,0)node [below]{$n$};
\draw[densely dotted] (2)--++(-90:1.2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容