我可以得到一些帮助来绘制偏振椭圆,如下所示:

我可以得到一些帮助来绘制偏振椭圆,如下所示:

需要帮助在 tikz 中绘制这个。

在此处输入图片描述

答案1

抱歉,我评论中的代码不太正确。它有一个拼写错误,边界框也没有我想象的那么紧密。(提醒自己:不要写 TiiPad 上的 Z 代码,尤其是当它具有自动更正功能时。;-)

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\begin{scope}[dashed] 
 \draw (0,4) node[right]{$y$} -- (0,-4);
 \draw (5,0) node[above]{$x$} -- (-5,0);
\end{scope}
\begin{scope}[rotate=30] 
 \draw (0,0) circle (4 and 2); 
 \draw (0,4) node[left]{$y'$} --  (0,-4) node[pos=0.35,right]{$b$};
 \draw (5.5,0) node[above]{$x'$} -- (-5.5,0) node[pos=0.4,above]{$a$};
\end{scope}
\begin{scope}[local bounding box=elli,rotate=30] 
 \path plot[variable=\t,domain=0:360,samples=360] ({4*cos(\t)},{2*sin(\t)}); 
\end{scope}
\draw (elli.south west) rectangle (elli.north east);
\end{tikzpicture}
\end{document}

在此处输入图片描述

或者通过分析来确定边界框。

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{angles,quotes}
\begin{document}
\begin{tikzpicture}[declare function={a=4;b=2;alpha=30;}]
\begin{scope}[dashed] 
 \draw (0,5*b/3) node[right]{$y$} -- (0,-5*b/3);
 \draw (4*a/3,0) node[above]{$x$} -- (-4*a/3,0);
\end{scope}
\begin{scope}[rotate=alpha] 
 \draw (0,0) circle (a and b); 
 \draw (0,5*b/3) node[left]{$y'$} --  (0,-5*b/3) node[pos=0.35,right]{$b$};
 \draw (4*a/3,0) node[above]{$x'$} -- (-4*a/3,0) node[pos=0.4,above]{$a$};
 \path 
 ({a*cos(atan(-(b/a)*tan(alpha)))},{b*sin(atan(-(b/a)*tan(alpha)))}) coordinate (aux1)
 ({a*cos(atan((b/a)*cot(alpha)))},{b*sin(atan((b/a)*cot(alpha)))}) coordinate (aux2) 
 ({-a*cos(atan(-(b/a)*tan(alpha)))},{-b*sin(atan(-(b/a)*tan(alpha)))}) coordinate (aux3)
 ({-a*cos(atan((b/a)*cot(alpha)))},{-b*sin(atan((b/a)*cot(alpha)))}) coordinate (aux4); 
\end{scope}
\draw (aux3|-aux4) rectangle (aux1|-aux2);
\path (0:1) coordinate (A) (0,0) coordinate[label={[xshift=0.3em]below left:{$O$}}] (O)
 (alpha:1) coordinate (C) 
pic ["$\Psi$",draw,latex-latex,angle radius=1.8cm,angle eccentricity=1.2] {angle = A--O--C};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容