-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquat.html
More file actions
173 lines (170 loc) · 9.41 KB
/
quat.html
File metadata and controls
173 lines (170 loc) · 9.41 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<!-- Created by Justinas Tijunelis -->
<html>
<head>
<title>Quaternions</title>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div class="mobile" style="font-size: 5rem;">
Too lazy to do mobile version.
</div>
<div class="desktop">
<!-- Top Bar -->
<div id="topbar">
<div id="top">
<h1>Rotations and Applications</h1>
</div>
<div id="nav">
<div class="row">
<div class="column">
<a href="index.html">
<div id="navButton" style="background-color:#F5888240">
<b>Introduction</b>
</div>
</a>
</div>
<div class="column">
<a href="quat.html">
<div id="navButton" style="background-color:#69D4F5FF">
<b>Quaternions</b>
</div>
</a>
</div>
<div class="column">
<a href="vector.html">
<div id="navButton" style="background-color:#B466E140">
<b>Vectors</b>
</div>
</a>
</div>
<div class="column">
<a href="app.html">
<div id="navButton" style="background-color:#5DF59740">
<b>Applications</b>
</div>
</a>
</div>
</div>
</div>
</div>
<!-- End Top Bar -->
<!-- Start Content -->
<div id="content">
<div class="flex-container" id="quat-flex">
<div id="mediumbox">
<h2 style="text-align:left; font-size: 2vw; padding-left: 20px;">What is a quaternion?</h2>
<p style="text-align: left; font-size: 1.5vw; padding: 20px">
Quaternions are a number system that extends the complex numbers. They represent rotational
transforms where an object rotates about an axis by some angle.
<p style="text-align: left; font-size: 1.5vw; padding: 20px">
Euler devised the Euler vector which took the form:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i>e</i> = (<i>θ</i>, <i>v</i>); where <i>v = (x, y, z)</i> is a vector in real space
<p style="text-align: left; font-size: 1.5vw; padding: 20px;">
the quaternion takes the form:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i>q</i> = <i style="color:#F58882;">w</i> + <i style="color:#69D4F5;">i</i>a + <i
style="color:#B466E1;">j</i>b + <i style="color:#5DF597;">k</i>c = (<i><i
style="color:#F58882;">w</i>, a, b, c</i>) =
(<i>cos(θ/2)</i>, <i>sin(θ/2)v</i>)
<p style="text-align: left; font-size: 1.5vw; padding: 20px;">
i, j, k are the fundamental quaternion units defined by:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i style="color:#69D4F5;">i</i><sup>2</sup> = <i style="color:#B466E1;">j</i><sup>2</sup> = <i
style="color:#5DF597;">k</i><sup>2</sup> = <i style="color:#69D4F5;">i</i><i
style="color:#B466E1;">j</i><i style="color:#5DF597;">k</i> = -1 (You can see why people
called
this evil...)
</div>
<div id="mediumbox">
<h2 style="text-align:left; font-size: 2vw; padding-left: 20px;">Properties of the quaternion</h2>
<p style="text-align: left; font-size: 1.5vw; padding: 20px">
<a
href="https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation#:~:text=Unit%20quaternions%2C%20also%20known%20as,tde%20problem%20of%20gimbal%20lock.">Unit
quaternion</a> rotations are applied through multiplication. So, a rotation defined as
<i>q<sub>A</sub></i>
multiplied by <i>q<sub>B</sub></i>, applies B then A (Right to left). However, this means that
quaternion
multiplication is non-commutative:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i>q<sub>A</sub></i> × <i>q<sub>B</sub></i> ≠ <i>q<sub>B</sub></i> ×
<i>q<sub>A</sub></i>
<p style="text-align: left; font-size: 1.5vw; padding: 20px">
the identity quaterion <i>q<sub>I</sub></i> is defined as (1, 0, 0, 0), and represents the "zero
rotation", that is:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i>q<sub>I</sub></i> × <i>q<sub>Any</sub></i> = <i>q<sub>Any</sub></i>
<p style="text-align: left; font-size: 1.5vw; padding: 20px">
Every quaternion also has a conjugate or "inverse" which applies an opposite rotation. It is
defined
as:
<p style="text-align: left; font-size: 1.5vw; padding: 20px; font-family:Cambria;">
<i>q<sup>*</sup></i> = <i>q<sup>-1</sup></i> = (<i><i style="color:#F58882;">-w</i>, v</i>);
<i>q</i> × <i>q<sup>*</sup></i> = <i>q<sub>I</sub></i>
</div>
<div id="widebox">
<div class="row">
<div class="column">
<h2 style="text-align:left; font-size: 2vw; padding-left: 20px;">Visualization</h2>
<div style='position:relative; padding-bottom:calc(55.63% + 44px); margin-right: 30px;'>
<iframe src='https://gfycat.com/ifr/CreativeAbleFulmar' frameborder='0' scrolling='no'
width='100%' height='100%' style='position:absolute;top:0;left:10px;'></iframe>
</div>
</div>
</div>
<div class="row">
<div class="column">
<h2 style="text-align:left; font-size: 2vw; padding-left: 20px;">Non-commutativity table
</h2>
<table style="font-family:Cambria; font-size: 1.5vw;">
<tbody>
<tr>
<th>
<div>×</div>
</th>
<th>1</th>
<th>i</th>
<th>j</th>
<th>k</th>
</tr>
<tr>
<th>1</th>
<td>1</td>
<td>i</td>
<td>j</td>
<td>k</td>
</tr>
<tr>
<th>i</th>
<td>i</td>
<td>-1</td>
<td style="background-color:#5DF597; color: white;">k</td>
<td style="background-color:#B466E1; color: white;">-j</td>
</tr>
<tr>
<th>j</th>
<td>j</td>
<td style="background-color:#5DF597; color: white;">-k</td>
<td>-1</td>
<td style="background-color:#69D4F5; color: white;">i</td>
</tr>
<tr>
<th>k</th>
<td>k</td>
<td style="background-color:#B466E1; color: white;">j</td>
<td style="background-color:#69D4F5; color: white;">-i</td>
<td>-1</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- End Content -->
</div>
</body>
</html>