TeX - LaTeX Asked on March 22, 2021
So I was preparing a lesson for my students about mechanical waves, and when I’ve reached the section of diffraction I needed to do some figures like these :
For the first one I’ve done it easily, and here’s the result :
and here’s the code :
begin{tikzpicture}[scale=0.8]
draw[smooth] (0,0)--(0,-6);
draw[smooth] (1,0)--(1,-6);
draw[smooth] (2,0)--(2,-6);
draw[smooth] (3,0)--(3,-6);
draw[smooth] (4,0)--(4,-6);
draw[ultra thick] (5,1)--(5,-2);
draw[ultra thick] (5,-3.5)--(5,-7);
draw[smooth,<->] (0.1,0)--(0.9,0) node[above, midway] {$lambda$};
draw[smooth] (6,-2)--(6,-3.5);
draw[smooth] (7,-2)--(7,-3.5);
draw[smooth] (8,-2)--(8,-3.5);
draw[smooth, <->] (6.1,-2)--(6.9,-2) node[above, midway] {$lambda$};
draw[smooth, ->] (5.5,-1)--(5.1,-1.9);
node[right] at (5.5,-0.9) {La fente $a$};
node[] at (5,1.4) {Figure $1$};
end{tikzpicture}
But I got some problems with the second figure, in the second part where the waves should be diffracted :
I can’t draw these arcs even I am using the arc code, I think I’m not understanding how it works :
begin{tikzpicture}
draw[smooth] (0,0)--(0,-6);
draw[smooth] (1,0)--(1,-6);
draw[smooth] (2,0)--(2,-6);
draw[smooth] (3,0)--(3,-6);
draw[smooth] (4,0)--(4,-6);
draw[ultra thick] (5,1)--(5,-2);
draw[ultra thick] (5,-3)--(5,-7);
draw[smooth,<->] (0.1,0)--(0.9,0) node[above, midway] {$lambda$};
draw[smooth, ->] (5,-1.9) arc (0:-50:3);
draw[smooth, ->] (5.5,-1)--(5.1,-1.9);
node[right] at (5.5,-0.9) {La fente $a$};
end{tikzpicture}
Any suggestions?
Something to get started
begin{tikzpicture}[scale=0.8]
draw[smooth] (0,0)--(0,-6);
draw[smooth] (1,0)--(1,-6);
draw[smooth] (2,0)--(2,-6);
draw[smooth] (3,0)--(3,-6);
draw[smooth] (4,0)--(4,-6);
draw[ultra thick] (5,1)--(5,-2);
draw[ultra thick] (5,-3.5)--(5,-7);
draw[smooth,<->] (0.1,0)--(0.9,0) node[above, midway] {$lambda$};
% draw[smooth] (6,-2)--(6,-3.5);
% draw[smooth] (7,-2)--(7,-3.5);
% draw[smooth] (8,-2)--(8,-3.5);
% draw[smooth, <->] (6.1,-2)--(6.9,-2) node[above, midway] {$lambda$};
% draw[smooth, ->] (5.5,-1)--(5.1,-1.9);
% node[right] at (5.5,-0.9) {La fente $a$};
node[] at (5,1.4) {Figure $1$};
defRadius{0.75}
draw
(5,-3.5) arc(-90:+90:Radius) -- cycle
;
end{tikzpicture}
and some more fine tuning
documentclass{article} % or another class
usepackage{xcolor} % before tikz or tkz-euclide if necessary
usepackage{tkz-euclide} % no need to load TikZ
begin{document}
begin{tikzpicture}[scale=0.8]
draw[smooth] (0,0)--(0,-6);
draw[smooth] (1,0)--(1,-6);
draw[smooth] (2,0)--(2,-6);
draw[smooth] (3,0)--(3,-6);
draw[smooth] (4,0)--(4,-6);
draw[ultra thick] (5,1)--(5,-2)coordinate(b);
draw[ultra thick] (5,-3.5)coordinate(a)--(5,-7);
draw[smooth,<->] (0.1,0)--(0.9,0) node[above, midway] {$lambda$};
node[] at (5,1.4) {Figure $1$};
defRadius{0.75}
draw[blue,thick]
(5,-3.5) arc(-90:+90:Radius)
;
draw[blue,thick]
($(5,-3.5)+(0,-0.5)$) arc(-90:+90:1.25)
;
draw[blue,thick]
($(5,-3.5)+(0,-1.5)$) arc(-90:+90:2.25)
;
draw[draw=none] (a)-- node[midway](b'){}(b);
draw[ <->, red]($(b')+(1.25,0)$) --($(b')+(2.25,0)$)node[above, midway] {$lambda$};
draw[->,red, thick]($(b')+(2.5,0)$) --($(b')+(3.5,0)$);
draw[->,red, thick, rotate=45]($(b')+(2.5,0)$) --($(b')+(3.5,0)$);
draw[->,red, thick, rotate=-45]($(b')+(2.5,0)$) --($(b')+(3.5,0)$);
draw[<->,red, ](a) --(b)node[left, midway] {$a$};
end{tikzpicture}
end{document}
Correct answer by js bibra on March 22, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP