-
Notifications
You must be signed in to change notification settings - Fork 0
/
ewaldsphere1.html
92 lines (86 loc) · 3.9 KB
/
ewaldsphere1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<title>Ewald Sphere Tutorial</title>
<link rel="stylesheet" href="index.css">
<body onload="setup();">
<nav>
<a href="ewaldintro.html">Introduction</a>
<a href="ewaldsphere1.html">1</a>
<a href="ewaldsphere2.html">2</a>
<a href="ewaldsphere3.html">3</a>
<a href="ewaldsphere4.html">4</a>
<a href="ewaldsphere5.html">5</a>
</nav>
<div id="controls">
<div>
<label>Rotate crystal around Z</label><br>
<input type="range" min="-45" max="45" value="0" id="anglez" hidden><br>
<button id="rotl5z">⟲</button>
<button id="rotl1z">↶</button>
<span>θ = <span id="thetaz">0</span>°</span>
<button id="rotr1z">↷</button>
<button id="rotr5z">⟳</button>
</div>
<div>
<button id="clear">Clear detector</button>
<button id="recentre">Reset view</button>
</div>
<div>
<input type="checkbox" id="fullbeams" name="fullbeams" Checked>
<label for="fullbeams">Show Full Beams</label>
</div>
<div>
<label for="a">Unit Cell Length in Å</label><br>
<input type="number" id="a" min="10" max="20" onchange="updateunitcelldimensions()" value="6">
</div>
<div>
<label>Rotate camera</label><br>
<input type="range" min="0" max="180" value="45" id="camera">
</div>
<div><img src="axes.png"/></div>
</div>
<canvas id="canvas"></canvas>
<div id="instructions">
<h2>Cubic unit cell diffraction</h2>
<p>First we will look at the Ewald sphere in 3D, and how it tells us about the diffraction pattern.</p>
<p>
In the centre panel, you can see a diffraction experiment with an X-ray beam hitting a crystal from the left.
On the right is a detector, which is initially blank.
The Ewald sphere is shown in red, with the reciprocal lattice centred on its surface.
Remember that the Ewald sphere and the reciprocal lattice are not real, they are mathematical constructions which
tell us when the conditions for diffraction are met - whenever a reciprocal lattice spot crosses the Ewald sphere.
</p>
<p>
In the left panel are the controls. The buttons at the top rotate the crystal (and the reciprocal lattice rotates with it).
When it is rotated far enough for a spot to cross the Ewald sphere, this will be highlighted on the sphere with a blue
dot, a line will be drawn following the diffracted beam from the crystal to the detector, and a spot will appear on the detector.
Use the ↶ button to rotate the crystal to θ = 8°, and you should see the (010) spot appear. (h is to the right, k is up, and l is out of the screen.)
Use the slider at the bottom of the controls to look at the scene from different angles.
</p>
<p>
Continue rotate the crystal to θ = 15°, at which point 3 more spots will appear: (011), (01<span style="text-decoration:overline">1</span>), and (020).
At what angle do the (021) and (02<span style="text-decoration:overline">1</span>) spots appear?
If you continue to rotate the crystal to θ = 30° some spots appear on the bottom half of the detector. These have a different h value. Can you deduce their indices?
</p>
</div>
<script>
var spacinga = 100 / 3;
var spacingb = 100 / 3;
var spacingc = 100 / 3;
var alpha = 90;
var beta = 90;
</script>
<script src="three.js"></script>
<script src="OrbitControls.js"></script>
<script src="index.js"></script>
<script>
function updateunitcelldimensions() {
spacinga = 100 / Number(document.getElementById("a").value);
spacingb = 100 / Number(document.getElementById("a").value);
spacingc = 100 / Number(document.getElementById("a").value);
alpha = 90;
beta = 90;
updateunitcell();
reset();
}
</script>
</body>