法线矢量和线

法线矢量和线

我正在尝试制作图中所示的内容。我已完成以下操作,但看起来不像三维的。我该如何进行一些更改?

在此处输入图片描述

\documentclass[11pt]{article}
%\documentclass[border=3pt]{standalone}

\tikzset{my node dot/.style={circle,fill=black,inner sep=0pt,minimum size=3pt}}
\usepackage{color}
\definecolor{dartmouthgreen}{rgb}{0.05, 0.5, 0.06}
\definecolor{debianred}{rgb}{0.84, 0.04, 0.33}

\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate (O) at (0,0);
\node[midway,below] at (0,0) {$P_0$};
%\draw[-,fill=white!95!red](0,0)--(3,0)--(4,1)--(1,1)--cycle;
%\node at (2,0.5) {$|\vec{\textcolor{blue}{a}}\times \vec{\textcolor{red}{b}}|$};
\draw[ultra thick,blue](-3,0)--(3,0)node[midway,below]{$$};
%\draw[ultra thick,-latex,red](0,0)--(1,1)node[midway,above]{$b$};
\draw[ultra thick,-latex,blue!50!red](0,0)--(0,3)node[pos=0.7,right]{$\vec n$};
%\draw (0.6,0) arc [start angle=0,end angle=45,radius=0.6]
%node[pos=0.7,right]{$v$};
%\draw[ultra thick,-latex,blue!50!red](0,0)--(0,3)node[pos=0.7,right]{$\vec n$};

 % \draw [color=gray, dashed] (P) -- (Q) -- (R) ;
 \draw[ultra thick,dartmouthgreen](-2,-2)--(2,2)node[midway,below]{$$};
   \draw[ultra thick,red] (O) ++ (6pt,0) -- ++ (0,6pt) -- ++ (-6pt,0);
  \draw[ultra thick,magenta](2,-2)--(-2,2)node[midway,below]{$$};
\end{tikzpicture}
\end{document}

答案1

这是一个解决方案:

\documentclass{article}
\usepackage{tikz,tikz-3dplot}

\usepackage{color}
\definecolor{dartmouthgreen}{rgb}{0.05, 0.5, 0.06}
\definecolor{debianred}{rgb}{0.84, 0.04, 0.33}

\begin{document}


\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords]
\coordinate (O) at (0,0,0);
\draw[dartmouthgreen] (-1,0,0) -- (1,0,0);
\draw[magenta] (0,-1,0) -- (0,1,0);
\draw[blue] (-0.7071,-0.7071,0) -- (0.7071,0.7071,0);
\draw[->,violet] (0,0,0) -- (0,0,1) node[anchor=south]{$\vec n$};
\draw[thick, red] (0,0,0.2) -- (0,0.2,0.2) -- (0,0.2,0);
\end{tikzpicture}

\end{document}

请注意,我删除了超厚选项,我认为如果没有它,图片会更清晰。

在此处输入图片描述

相关内容