使用 TikZ 重建衍射图像

使用 TikZ 重建衍射图像

我想使用 TikZ 在曲面屏幕上重现下面的图像,即电子束穿过碳靶并被碳靶衍射。不幸的是,它看起来有点超出我的技能水平。我该如何重现这个图像?

在此处输入图片描述

答案1

以下是拖延症团队的一次尝试元帖子。实际上,它是一个非常好看的图表;您只需指定ell和,theta以及屏幕半径的比例ell,程序就会使用和勾股减法运算符的组合来计算所需的sind另一个angle角度+-+

我不确定如何在 OP 屏幕上表示衍射图案,所以我把它们去掉了。粉色线条只是为了展示构造,应该从最终版本中删除。尽情享受吧!

在此处输入图片描述

prologues := 3;
outputtemplate := "%j%c.eps";

beginfig(1);
% parameters
theta = 5;
ell = 10cm;
R   = 0.42 ell;

% calculate alpha
h = (ell-R)*sind(2theta);
alpha = 2theta + angle (R+-+h,h);

% define paths
path target, screen, a[];
target = unitsquare shifted -(.5,.5) xscaled 3 yscaled 12 shifted (R-ell,0);
screen = (R,0) rotated -1.1 alpha .. (R,0){up} .. (R,0) rotated 1.1 alpha;

% draw the various guides
drawoptions(withcolor .7 white);
draw (R-ell-1cm,0) -- (R+1cm,0) dashed dashpattern(on 40 off 6 on 8 off 6);
draw (R-ell,0) -- (R-ell,-2.5cm);
draw (R    ,0) -- (R    ,-2.5cm);
a1 = (R-ell,-2.2cm) -- (R, -2.2cm);
picture t; t = thelabel(btex $\ell$ etex,point 1/2 of a1);
drawdblarrow a1; unfill bbox t; draw t;

% draw the gubbins around the carbon target
drawoptions(withpen pencircle scaled 2);
draw (4 left -- right) scaled 4 shifted center target shifted 10 up;
draw (4 left -- right) scaled 4 shifted center target shifted 10 down;
drawoptions();
draw (up--down) scaled 10 shifted center target;
fill target; 

% and the screen
draw screen withpen pencircle scaled 2;
draw screen withpen pencircle scaled 1.2 withcolor background;

% add some beam arrows
drawarrow (20 left -- origin) shifted point 3.5 of target;
drawarrow center target -- (R-1,0) rotated alpha;
drawarrow center target -- (R-1,0) rotated -alpha;

% mark the beam angle
a2 = ((R,0) {up} .. (R,0) rotated(2 theta)) shifted (R-ell,0);
ahlength := 3; ahangle := 30;
drawdblarrow a2 withcolor .7 white;
label.rt(btex $2\theta$ etex, point .5 of a2) withcolor .7 white;

% add labels
label(btex Screen etex, point 1.6 of screen + 20 right);
label(btex Carbon target etex, center target + 24 up);

% this bit is just to show the construction, and should be deleted...
drawoptions(withcolor .7[red,white]);
fill fullcircle scaled 3;
draw subpath(-1,1) of fullcircle scaled 2R;
draw origin -- (R,0) rotated alpha; 
label(btex $\alpha$ etex, 25 right rotated 1/2 alpha);
%---------------------------------------------------------

endfig;
end.

相关内容