forked from w3c/deviceorientation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1012 lines (809 loc) · 49.3 KB
/
index.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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head>
<title>DeviceOrientation Event Specification</title>
<meta content="text/html;charset=utf-8" http-equiv=Content-Type>
<style type="text/css">
dt, dfn { font-weight: bold; font-style: normal; }
img.extra { float: right; }
body ins, body del { display: block; }
body * ins, body * del { display: inline; }
pre, code { color: black; background: transparent; font-size: inherit; font-family: monospace; }
pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
pre em { font-weight: bolder; font-style: normal; }
pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em; }
table { border-collapse: collapse; border-style: hidden hidden none hidden; }
table thead { border-bottom: solid; }
table tbody th:first-child { border-left: solid; }
table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
ul.toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
ul.toc li ul { margin-bottom: 0.75em; }
ul.toc li ul li ul { margin-bottom: 0.25em; }
var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
@media screen { code { color: rgb(255, 69, 0); background: transparent; } }
code :link, code :visited { color: inherit; background: transparent; }
.example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 1em; padding-left: 1em; }
.issue, .big-issue { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
.issue > :first-child, .big-issue > :first-child { margin-top: 0; }
p .big-issue { line-height: 3em; }
.note { color: green; background: transparent; }
.note { font-family: sans-serif; }
p.note:before { content: 'Note: '; }
.warning { color: red; background: transparent; }
.warning:before { font-style: normal; }
p.warning:before { content: '\26A0 Warning! '; }
.note, .warning { font-weight: bolder; font-style: italic; padding: 0.5em 2em; }
.copyright { margin: 0.25em 0; }
img { max-width: 100%; }
h4 + .element { margin-top: -2.5em; padding-top: 2em; }
h4 + p + .element { margin-top: -5em; padding-top: 4em; }
.element { background: #EEEEFF; color: black; margin: 0 0 1em -1em; padding: 0 1em 0.25em 0.75em; border-left: solid #9999FF 0.25em; }
table.matrix, table.matrix td { border: none; text-align: right; }
table.matrix { margin-left: 2em; }
ol#rotations li div { display: inline-block; width: 350px; margin-right: 20px; font-size: small; }
ol#rotations li div img { width: 350px; }
object.equation { display: block; margin: 20px 20px; width: 100%; height: inherit; }
</style>
<link href="https://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet type="text/css">
</head>
<body>
<div class=head> <!--begin-logo-->
<p><a href="https://www.w3.org/"><img height="48" width="72" alt="W3C" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C"/></a> <!--end-logo-->
<h1 id="title_heading">DeviceOrientation Event Specification</h1>
<h2 class="no-num no-toc" id="draft_date">Editor's Draft 15 August 2018</h2>
<dl>
<!-- <dt>This Version:</dt>
<dd><a href="http://www.w3.org/TR/2009/WD-geolocation-API-20090707/">http://www.w3.org/TR/2009/WD-geolocation-API-20090707/</a></dd> -->
<dt>Latest Published Version:
<dd><a
href="http://www.w3.org/TR/orientation-event/">http://www.w3.org/TR/orientation-event/</a>
<dt>Latest Editor's Draft:
<dd><a
href="https://w3c.github.io/deviceorientation/">https://w3c.github.io/deviceorientation/</a></dd>
<!-- <dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2008/WD-geolocation-API-20081222/">http://www.w3.org/TR/2008/WD-geolocation-API-20081222/</a></dd> -->
<dt>Editors:</dt>
<dd>Rich Tibbett, Opera Software ASA</dd>
<dd>Tim Volodine, Google, Inc</dd>
<dd>Steve Block, Google, Inc (until July 2012)</dd>
<dd>Andrei Popescu, Google, Inc (until July 2012)</dd>
<dt>Participate:</dt>
<dd><a href="https://github.com/w3c/deviceorientation">We are on GitHub</a></dd>
<dd><a href="https://github.com/w3c/deviceorientation/issues">File a bug</a></dd>
<dd><a href="https://github.com/w3c/deviceorientation/commits">Commit history</a></dd>
<dd><a href="https://lists.w3.org/Archives/Public/public-device-apis/">Mailing list</a></dd>
</dl>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2018 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
<p> This document is governed by the <a href="https://www.w3.org/2018/Process-20180201/" id="w3c_process_revision">1 February 2018 W3C Process Document</a>. </p>
<hr>
</div>
<h2 class="no-num no-toc" id="abstract">Abstract</h2>
<p>This specification defines several new DOM events that provide
information about the physical orientation and motion of a hosting device.</p>
<h2 class="no-num no-toc" id="status">Status of This Document</h2>
<!-- intro boilerplate (required) -->
<p><em>This section describes the status of this document at the time
of its publication. Other documents may supersede this document. A
list of current W3C publications and the latest revision of this
technical report can be found in
the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at
http://www.w3.org/TR/.</em></p>
<!-- where to send feedback (required) -->
<p>This document was published by the <a
href="https://www.w3.org/das/">Devices and Sensors Working Group</a>.
If you wish to make comments regarding this document, please send
them to <a
href="mailto:[email protected]">[email protected]</a> (<a
href="mailto:[email protected]?subject=subscribe">subscribe</a>,
<a
href="http://lists.w3.org/Archives/Public/public-device-apis/">archives</a>).</p>
<p>All feedback is welcome.</p>
<!-- stability (required) -->
<p>Publication as a Working Draft does not imply endorsement by the
W3C Membership. This is a draft document and may be updated, replaced
or obsoleted by other documents at any time. It is inappropriate to
cite this document as other than work in progress.</p>
<!-- required patent boilerplate -->
<p>This is the First Public Working draft of this specification. <b>It should not be considered stable.</b> When providing feedback, please first refer to the <a href="https://w3c.github.io/deviceorientation/">Editor's Draft</a> and confirm that the issue has not been addressed already. If the issue has not been addressed, please describe it on the <a href="http://lists.w3.org/Archives/Public/public-device-apis/">public mailing list</a>.</p>
<p> This document was produced by a group operating under the <a
href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>. W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/43696/status" rel="disclosure">public list of any patent disclosures</a>
made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has
actual knowledge of a patent which the individual believes contains <a
href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.
<h2 class="no-num no-toc" id="contents">Table of Contents</h2>
<!--begin-toc-->
<ul class=toc>
<li><a href="#conformance-requirements"><span class=secno>1 </span>Conformance requirements</a>
<li><a href="#introduction"><span class=secno>2 </span>Introduction</a>
<li><a href="#scope"><span class=secno>3 </span>Scope</a>
<li><a href="#description"><span class=secno>4 </span>Description</a>
<ul class=toc>
<li><a href="#deviceorientation"><span class=secno>4.1 </span>deviceorientation Event</a>
<li><a href="#deviceorientationabsolute"><span class=secno>4.2 </span>deviceorientationabsolute Event</a>
<li><a href="#compassneedscalibration"><span class=secno>4.3 </span>compassneedscalibration Event</a>
<li><a href="#devicemotion"><span class=secno>4.4 </span>devicemotion Event</a>
</ul>
<li><a href="#security-and-privacy"><span class=secno>5 </span>Security and privacy considerations</a>
<li><a href="#use-cases-and-requirements"><span class=secno>6 </span>Use-Cases and Requirements</a>
<ul class=toc>
<li><a href="#use-cases"><span class=secno>6.1 </span>Use-Cases</a>
<li><a href="#requirements"><span class=secno>6.2 </span>Requirements</a>
</ul>
<li><a href="#examples"><span class=secno>A </span>Examples</a>
<ul class=toc>
<li><a href="#worked-example"><span class=secno>A.1 </span>Calculating compass heading</a>
<li><a href="#worked-example-2"><span class=secno>A.2 </span>Alternate device orientation representations</a>
</ul>
<li><a href="#acknowledgments">Acknowledgments</a>
<li><a href="#references">References</a>
</ul>
<!--end-toc-->
<h2 id="conformance-requirements"><span class=secno>1 </span>Conformance requirements</h2>
<p>All diagrams, examples, and notes in this specification are
non-normative, as are all sections explicitly marked non-normative.
Everything else in this specification is normative.
<p>The key words "MUST", "MUST NOT", "REQUIRED", <!--"SHALL", "SHALL
NOT",-->
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in the
normative parts of this document are to be interpreted as described in
RFC2119. For readability, these words do not appear in all uppercase
letters in this specification. <a href="#ref-rfc2119">[RFC2119]</a></p>
<!-- XXX but they should be
marked up -->
<p>Requirements phrased in the imperative as part of algorithms (such as
"strip any leading space characters" or "return false and abort these
steps") are to be interpreted with the meaning of the key word ("must",
"should", "may", etc) used in introducing the algorithm.
<p>Conformance requirements phrased as algorithms or specific steps may be
implemented in any manner, so long as the end result is equivalent. (In
particular, the algorithms defined in this specification are intended to
be easy to follow, and not intended to be performant.)
<p id="hardwareLimitations">User agents may impose implementation-specific
limits on otherwise unconstrained inputs, e.g. to prevent denial of
service attacks, to guard against running out of memory, or to work around
platform-specific limitations.
<p>Implementations that use ECMAScript to implement the APIs defined in
this specification must implement them in a manner consistent with the
ECMAScript Bindings defined in the Web IDL specification, as this
specification uses that specification's terminology. <a
href="#ref-webidl">[WEBIDL]</a>
<p>The events introduced by this specification implement the Event interface
defined in the DOM4 Specification,
<a href="#ref-domevents">[DOM4]</a>.
Implementations must therefore support this specification.
<h2 id="introduction"><span class=secno>2 </span>Introduction</h2>
<p><em>This section is non-normative.</em>
<p>This specification provides several new DOM events for obtaining
information about the physical orientation and movement of the hosting device.
The information provided by the events is not raw sensor data, but rather
high-level data which is agnostic to the underlying source of information.
Common sources of information include gyroscopes, compasses and
accelerometers.
<p>The first DOM event provided by the specification,
<code>deviceorientation</code>, supplies the physical orientation of the
device, expressed as a series of rotations from a local coordinate frame.
<p>The second DOM event provided by this specification,
<code>devicemotion</code>, supplies the acceleration of the device, expressed
in Cartesian coordinates in a coordinate frame defined in the device.
It also supplies the rotation rate of the device about a local coordinate
frame. Where practically possible, the event should provide the acceleration
of the device's center of mass.
<p>Finally, the specification provides a <code>compassneedscalibration</code>
DOM event, which is used to inform Web sites that a compass being used to
provide data for one of the above events is in need of calibration.
<p>The following code extracts illustrate basic use of the events.
<div class=example>
<p>Registering to receive
<a href="#deviceorientation"><code>deviceorientation</code></a>
events:</p>
<pre>
window.addEventListener("deviceorientation", function(event) {
// process event.alpha, event.beta and event.gamma
}, true);
</pre>
</div>
<div class=example>
<p>A device lying flat on a horizontal surface with the top of the
screen pointing West has the following orientation:</p>
<pre>
{alpha: 90,
beta: 0,
gamma: 0};
</pre>
<p> To get the compass heading, one would simply
subtract <code>alpha</code> from 360 degrees. As the device is
turned on the horizontal surface, the compass heading is (360
- <code>alpha</code>).</p>
</div>
<div class=example>
<p>A user is holding the device in their hand, with the screen in
a vertical plane and the top of the screen pointing upwards. The
value of <code>beta</code> is 90, irrespective of
what <code>alpha</code> and <code>gamma</code> are.</p>
</div>
<div class=example>
<p>A user facing a compass heading of alpha degrees is holding the
device in their hand, with the screen in a vertical plane and the
top of the screen pointing to their right. The orientation of the
device is:</p>
<pre>
{alpha: 270 - alpha,
beta: 0,
gamma: 90};
</pre>
</div>
<div class=example>
<p>Showing custom UI to instruct the user to calibrate the compass:</p>
<pre>
window.addEventListener("compassneedscalibration", function(event) {
alert('Your compass needs calibrating! Wave your device in a figure-eight motion');
event.preventDefault();
}, true);
</pre>
</div>
<div class=example>
<p>Registering to receive
<a href="#motionevent"><code>devicemotion</code></a> events:</p>
<pre>
window.addEventListener("devicemotion", function(event) {
// Process event.acceleration, event.accelerationIncludingGravity,
// event.rotationRate and event.interval
}, true);
</pre>
</div>
<div class=example>
<p>A device lying flat on a horizontal surface with the screen upmost has
an <code>acceleration</code> of zero and the following value for
<code>accelerationIncludingGravity</code>:</p>
<pre>
{x: 0,
y: 0,
z: 9.81};
</pre>
</div>
<div class=example>
<p>A device in free-fall, with the screen horizontal and upmost, has an
<code>accelerationIncludingGravity</code> of zero and the following value
for <code>acceleration</code>:</p>
<pre>
{x: 0,
y: 0,
z: -9.81};
</pre>
</div>
<div class=example>
<p>A device is mounted in a vehicle, with the screen in a vertical plane,
the top uppermost and facing the rear of the vehicle. The vehicle is
travelling at speed v around a right-hand bend of radius r. The
device records a positive x component for both <code>acceleration</code>
and <code>accelerationIncludingGravity</code>. The device also records a
negative value for <code>rotationRate.gamma</code>:</p>
<pre>
{acceleration: {x: v^2/r, y: 0, z: 0},
accelerationIncludingGravity: {x: v^2/r, y: 0, z: 9.81},
rotationRate: {alpha: 0, beta: 0, gamma: -v/r*180/pi} };
</pre>
</div>
<h2 id="scope"><span class=secno>3 </span>Scope</h2>
<p><em>This section is non-normative.</em>
<p>This specification is limited to providing DOM events for retrieving
information describing the physical orientation and motion of the hosting
device. The intended purpose of this API is to enable simple use cases such
as those in <a href="#use-cases">Section 6.1</a>.
The scope of this specification does not include providing utilities to
manipulate this data, such as transformation libraries. Nor does it include
providing access to low sensor data, or direct control of these sensors.
<h2 id="description"><span class=secno>4 </span>Description</h2>
<h3 id="deviceorientation"><span class=secno>4.1 </span>deviceorientation Event</h3>
<p>User agents implementing this specification must provide a new DOM event,
named <code>deviceorientation</code>. The corresponding event must be of
type <code>DeviceOrientationEvent</code> and must fire on the
<code>window</code> object. Registration for, and firing of the
<code>deviceorientation</code> event must follow the usual behavior of DOM4 Events,
<a href="#ref-domevents">[DOM4]</a>.
<p>User agents must also provide an event handler IDL attribute
<a href="#ref-html5">[HTML51]</a> named <code>ondeviceorientation</code> on the
<code>window</code> object. The type of the corresponding
<a href="https://www.w3.org/TR/html5/webappapis.html#event-handler-event-type">event handler event type</a>
must be <code>deviceorientation</code>.
<pre class=idl>
partial interface Window {
attribute EventHandler ondeviceorientation;
};
[Constructor(DOMString type, optional DeviceOrientationEventInit eventInitDict), Exposed=Window]
interface <dfn id="deviceorientation_event">DeviceOrientationEvent</dfn> : Event {
readonly attribute double? alpha;
readonly attribute double? beta;
readonly attribute double? gamma;
readonly attribute boolean absolute;
};
dictionary DeviceOrientationEventInit : EventInit {
double? alpha = null;
double? beta = null;
double? gamma = null;
boolean absolute = false;
};
</pre>
<p>The <code>alpha</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>beta</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>gamma</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>absolute</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to false.</p>
<p>The event should fire whenever a significant change in orientation occurs.
The definition of a significant change in this context is left to the
implementation, though a maximum threshold for change of one degree is
recommended. Implementations may also fire the event if they have reason to
believe that the page does not have sufficiently fresh data.</p>
<p>The <code>alpha</code>, <code>beta</code> and <code>gamma</code> attributes
of the event must specify the orientation of the device in terms of the
transformation from a coordinate frame fixed on the Earth to a
coordinate frame fixed in the device. The coordinate frames must be oriented
as described below.</p>
<p>The Earth coordinate frame is a 'East, North, Up' frame at the user's
location. It has the following 3 axes, where the ground plane is tangent to
the spheriod of the World Geodetic System 1984
<a href="#ref-wgs84">[WGS84]</a>, at the user's location.
<ul>
<li>East (X) is in the ground plane, perpendicular to the North axis and positive towards the East.</li>
<li>North (Y) is in the ground plane and positive towards True North (towards the North Pole).</li>
<li>Up (Z) is perpendicular to the ground plane and positive upwards.</li>
</ul>
<p>For a mobile device such as a phone or tablet, the device coordinate frame
is defined relative to the screen in its standard orientation, typically
portrait. This means that slide-out elements such as keyboards are not
deployed, and swiveling elements such as displays are folded to their default
position. If the
orientation of the screen changes when the device is rotated or a slide-out
keyboard is deployed, this does not affect the orientation of the coordinate
frame relative to the device. Users wishing to detect these changes in screen
orientation may be able to do so with the existing
<code>orientationchange</code> event.
For a laptop computer, the device coordinate frame is defined relative to the
integrated keyboard.
<ul>
<li>x is in the plane of the screen or keyboard and is positive towards the right hand side of the screen or keyboard.</li>
<li>y is in the plane of the screen or keyboard and is positive towards the top of the screen or keyboard.</li>
<li>z is perpendicular to the screen or keyboard, positive out of the screen or keyboard.</li>
</ul>
<p>The transformation from the Earth coordinate frame to the device coordinate
frame must use the following system of rotations.
<p>Rotations must use the right-hand convention, such that positive rotation
around an axis is clockwise when viewed along the positive direction of the
axis. Starting with the two frames aligned, the rotations are applied in the
following order:</p>
<ol id="rotations">
<li>
<p>Rotate the device frame around its z axis by <code>alpha</code> degrees, with <code>alpha</code> in [0, 360).</p>
<div>
<img src="start.png" alt="start orientation">
<div>Device in the initial position, with Earth (XYZ) and body (xyz) frames aligned.</div>
</div>
<div>
<img src="c-rotation.png" alt="rotation about z axis">
<div>Device rotated through angle alpha about z axis, with previous locations of x and y axes shown as x<sub>0</sub> and y<sub>0</sub>.</div>
</div>
</li>
<li>
<p>Rotate the device frame around its x axis by <code>beta</code> degrees, with <code>beta</code> in [-180, 180).</p>
<div>
<img src="a-rotation.png" alt="rotation about x axis">
<div>Device rotated through angle beta about new x axis, with previous locations of y and z axes shown as y<sub>0</sub> and z<sub>0</sub>.</div>
</div>
</li>
<li>
<p>Rotate the device frame around its y axis by <code>gamma</code> degrees, with <code>gamma</code> in [-90, 90).</p>
<div>
<img src="b-rotation.png" alt="rotation about y axis">
<div>Device rotated through angle gamma about new y axis, with previous locations of x and z axes shown as x<sub>0</sub> and z<sub>0</sub>.</div>
</div>
</li>
</ol>
<p>Thus the angles <code>alpha</code>, <code>beta</code> and
<code>gamma</code> form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''.
<a href="#ref-eulerangles">[EULERANGLES]</a>
Note that this choice of angles follows mathematical convention, but means
that <code>alpha</code> is in the opposite sense to a compass heading. It also
means that the angles do not match the roll-pitch-yaw convention used in
vehicle dynamics.</p>
<p>The <code>deviceorientation</code> event tries to provide relative values
for the three angles (relative to some arbitrary orientation), based on just
the accelerometer and the gyroscope.
The implementation can still decide to provide absolute orientation if relative is
not available or the resulting data is more accurate. In either case, the
<code>absolute</code> property must be set accordingly to reflect the choice.</p>
<p> Implementations that are unable to provide all three angles must
set the values of the unknown angles to null. If any angles are provided, the
<code>absolute</code> property must be set appropriately. If an implementation
can never provide orientation information, the event should be fired with the
<code>alpha</code>, <code>beta</code> and <code>gamma</code> attributes set to
null.</p>
<h3 id="deviceorientationabsolute"><span class=secno>4.2 </span>deviceorientationabsolute Event</h3>
<p>User agents implementing this specification must provide a new DOM event,
named <code>deviceorientationabsolute</code>. The corresponding event must be of
type <code>DeviceOrientationEvent</code> and must fire on the
<code>window</code> object. Registration for, and firing of the
<code>deviceorientationabsolute</code> event must follow the usual behavior of DOM4 Events,
<a href="#ref-domevents">[DOM4]</a>.
<p>User agents must also provide an event handler IDL attribute
<a href="#ref-html5">[HTML51]</a> named <code>ondeviceorientationabsolute</code> on the
<code>window</code> object. The type of the corresponding
<a href="https://www.w3.org/TR/html5/webappapis.html#event-handler-event-type">event handler event type</a>
must be <code>deviceorientationabsolute</code>.
<pre class=idl>
partial interface Window {
attribute EventHandler ondeviceorientationabsolute;
};
</pre>
<p>The <code>deviceorientationabsolute</code> event is completely analogous to the
<code>deviceorientation</code> event, except additional sensors like the magnetometer
can be used to provide an absolute orientation. The <code>absolute</code> property must
be set to <code>true</code>. If an implementation can never provide absolute
orientation information, the event should be fired with the <code>alpha</code>,
<code>beta</code> and <code>gamma</code> attributes set to null.</p>
<h3 id="compassneedscalibration"><span class=secno>4.3 </span>compassneedscalibration Event</h3>
<p>User agents implementing this specification must provide a new DOM event,
named <code>compassneedscalibration</code> that uses the <code>Event</code>
interface defined in the DOM4 Events specification
<a href="#ref-domevents">[DOM4]</a>. This event must fire on the
<code>window</code> object. Registration for, and firing of the
<code>compassneedscalibration</code> event must follow the usual behavior of
DOM4 Events <a href="#ref-domevents">[DOM4]</a>.
<p>User agents must also provide an event handler IDL attribute
<a href="#ref-html5">[HTML51]</a> named <code>oncompassneedscalibration</code>
on the <code>window</code> object. The type of the corresponding event must be
<code>compassneedscalibration</code>.
<p>This event must be fired when the user agent determines that a compass used
to obtain orientation data is in need of calibration. Furthermore, user agents
should only fire the event if calibrating the compass will increase the
accuracy of the data provided by the
<code><a href="#deviceorientation">deviceorientation</a></code> event.
<p>The default action of this event should be for the user agent to present the
user with details of how to calibrate the compass. The event must be
cancelable, so that web sites can provide their own alternative calibration
UI.
<h3 id="devicemotion"><span class=secno>4.4 </span>devicemotion Event</h3>
<p>User agents implementing this specification must provide a new DOM event,
named <code>devicemotion</code>. The corresponding event must be of type
<code>DeviceMotionEvent</code> and must fire on the <code>window</code>
object.
Registration for, and firing of the <code>devicemotion</code>
event must follow the usual behavior of DOM4 Events,
<a href="#ref-domevents">[DOM4]</a>.
<p>User agents must also provide an event handler IDL attribute
<a href="#ref-html5">[HTML51]</a> named <code>ondevicemotion</code>
on the <code>window</code> object. The type of the corresponding
<a href="https://www.w3.org/TR/html5/webappapis.html#event-handler-event-type">event handler event type</a>
must be <code>devicemotion</code>.
<pre class=idl>
partial interface Window {
attribute EventHandler ondevicemotion;
};
[NoInterfaceObject]
interface <dfn id="device_acceleration">DeviceAcceleration</dfn> {
readonly attribute double? x;
readonly attribute double? y;
readonly attribute double? z;
};
[NoInterfaceObject]
interface <dfn id="device_rotation_rate">DeviceRotationRate</dfn> {
readonly attribute double? alpha;
readonly attribute double? beta;
readonly attribute double? gamma;
};
[Constructor(DOMString type, optional DeviceMotionEventInit eventInitDict), Exposed=Window]
interface <dfn id="devicemotion_event">DeviceMotionEvent</dfn> : Event {
readonly attribute DeviceAcceleration? acceleration;
readonly attribute DeviceAcceleration? accelerationIncludingGravity;
readonly attribute DeviceRotationRate? rotationRate;
readonly attribute double interval;
};
dictionary DeviceAccelerationInit {
double? x = null;
double? y = null;
double? z = null;
};
dictionary DeviceRotationRateInit {
double? alpha = null;
double? beta = null;
double? gamma = null;
};
dictionary DeviceMotionEventInit : EventInit {
DeviceAccelerationInit acceleration;
DeviceAccelerationInit accelerationIncludingGravity;
DeviceRotationRateInit rotationRate;
double interval = 0;
};
</pre>
<p>The <code>acceleration</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>accelerationIncludingGravity</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>rotationRate</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to null.</p>
<p>The <code>interval</code> attribute must return the value it was initialized to.
When the object is created, this attribute must be initialized to 0.</p>
<p>In the <code>DeviceMotionEvent</code> events fired by the user agent, the following requirements
must apply:</p>
<p>The <code>acceleration</code> attribute must be initialized with the acceleration of the
hosting device relative to the Earth frame, expressed in the body frame, as
defined in <a href="#deviceorientation">section 4.1</a>. The acceleration must
be expressed in meters per second squared (m/s<sup>2</sup>).
<p>Implementations that are unable to provide acceleration data without the
effect of gravity (due, for example, to the lack of a gyroscope) may instead
supply the acceleration including the effect of gravity. This is less useful
in many applications but is provided as a means of providing best-effort
support. In this case, the <code>accelerationIncludingGravity</code> attribute
must be initialized with the acceleration of the hosting device, plus an acceleration
equal and opposite to the acceleration due to gravity. Again, the acceleration
must be given in the body frame defined in
<a href="#deviceorientation">section 4.1</a> and must be expressed in meters per second squared (m/s<sup>2</sup>).
<p>The <code>rotationRate</code> attribute must be initialized with the rate of rotation of
the hosting device in space. It must be expressed as the rate of change of
the angles defined in <a href="#deviceorientation">section 4.1</a> and
must be expressed in degrees per second (deg/s).
<p>The <code>interval</code> attribute must be initialized with the interval at which
data is obtained from the underlying hardware and must be expressed in
milliseconds (ms). It must be a constant, to simplify filtering of the data by the
Web application.
<p>Implementations that are unable to provide all attributes must
initialize the values of the unknown attributes to null. If an implementation
can never provide motion information, the event should be fired
with the <code>acceleration</code>, <code>accelerationIncludingGravity</code> and
<code>rotationRate</code> attributes set to null.
<h2 id="security-and-privacy"><span class=secno>5 </span>Security and privacy considerations</h2>
<p>The API defined in this specification can be used to obtain information from hardware sensors,
such as accelerometer, gyroscope and magnetometer. Provided data may be considered as sensitive and
could become a subject of attack from malicious web pages. The main attack vectors can be categorized
into following categories:
<ul>
<li>Monitoring of a user input <a href="#ref-touch">[TOUCH]</a></li>
<li>Location tracking <a href="#ref-indoorpos">[INDOORPOS]</a></li>
<li>User identification <a href="#ref-fingerprint">[FINGERPRINT]</a></li>
</ul>
In light of that, implementations may consider permissions or visual indicators to signify the use of sensors by the web page.
Furthermore, to minimize privacy risks, the chance of fingerprinting and other attacks the implementations must:
<ul>
<li>fire events only when <a href="https://html.spec.whatwg.org/multipage/browsers.html#active-document">active document</a> is
<a href="https://www.w3.org/TR/page-visibility-2/#dfn-steps-to-determine-the-visibility-state">visible</a>,</li>
<li>fire events only on the <a href="https://www.w3.org/TR/html5/browsers.html#top-level-browsing-context">top-level browsing context</a>
and same-origin <a href="https://html.spec.whatwg.org/multipage/browsers.html#nested-browsing-context">nested browsing contexts</a>,</li>
<li>fire events only on secure browsing contexts <a href="#ref-secure-contexts">[SECURE-CONTEXTS]</a></li>
</ul>
<p>Additionally, implementing these items may also have a beneficial impact on the battery life of mobile devices.
<h2 id="use-cases-and-requirements"><span class=secno>6 </span>Use-Cases and Requirements</h2>
<h3 id="use-cases"><span class=secno>6.1 </span>Use-Cases</h3>
<h4 id="controlling-a-game"><span class=secno>6.1.1 </span>Controlling a game</h4>
<p>A gaming Web application monitors the device's orientation and interprets
tilting in a certain direction as a means to control an on-screen sprite.
<h4 id="gesture-recognition"><span class=secno>6.1.2 </span>Gesture recognition</h4>
<p>A Web application monitors the device's acceleration and applies signal
processing in order to recognize certain specific gestures. For example, using
a shaking gesture to clear a web form.
<h4 id="mapping"><span class=secno>6.1.3 </span>Mapping</h4>
<p>A mapping Web application uses the device's orientation to correctly align
the map with reality.
<h3 id="requirements"><span class=secno>6.2 </span>Requirements</h3>
<h4 id="requirement-orientation"><span class=secno>6.2.1 </span>The specification must provide data that describes the physical orientation in space of the device.</h4>
<h4 id="requirement-motion"><span class=secno>6.2.2 </span>The specification must provide data that describes the motion in space of the device.</h4>
<h4 id="requirement-changes"><span class=secno>6.2.3 </span>The specification must allow Web applications to register for changes in the device's orientation.</h4>
<h4 id="requirement-agnostic"><span class=secno>6.2.4 </span>The specification must be agnostic to the underlying sources of orientation and motion data.</h4>
<h4 id="requirement-use-dom"><span class=secno>6.2.5 </span>The specification must use the existing DOM event framework.</h4>
<h2 id="examples">A. Examples</h2>
<!-- All equations in this section are created using MathJAX and are provided @ http://jsfiddle.net/richtr/w7Xgu/ -->
<h3 id="worked-example">A.1 Calculating compass heading</h3>
<p><em>This section is non-normative.</em>
<p>The following worked example is intended as an aid to users of the
DeviceOrientation event.
<p><a href="#introduction">Section 2</a> provided an example of using the
DeviceOrientation event to obtain a compass heading when the device is held
with the screen horizontal. This example shows how to determine the compass
heading that the user is 'facing' when holding the device with the screen
approximately vertical in front of them. An application of this is an
augmented-reality system.
<p>More precisely, we wish to determine the compass heading of the horizontal
component of a vector which is orthogonal to the device's screen and pointing
out of the back of the screen.
<p>If v represents this vector in the rotated device body frame xyz, then v
is as follows.
<object class="equation" data="equation1.xhtml" type="application/mathml+xml">
<p><img src="equation1.png" alt="v = [0; 0; -1]">
</object>
<p>The transformation of v due to the rotation about the z axis can be
represented by the following rotation matrix.
<object class="equation" data="equation2.xhtml" type="application/mathml+xml">
<img src="equation2.png" alt="Z = [cos(alpha) -sin(alpha) 0; sin(alpha) cos(alpha) 0; 0 0 1]">
</object>
<p>The transformation of v due to the rotation about the x axis can be
represented by the following rotation matrix.
<object class="equation" data="equation3.xhtml" type="application/mathml+xml">
<img src="equation3.png" alt="X = [1 0 0; 0 cos(beta) -sin(beta); 0 sin(beta) cos(beta)]">
</object>
<p>The transformation of v due to the rotation about the y axis can be
represented by the following rotation matrix.
<object class="equation" data="equation4.xhtml" type="application/mathml+xml">
<img src="equation4.png" alt="Y = [cos(gamma) 0 sin(gamma); 0 1 0; -sin(gamma) 0 cos(gamma)]">
</object>
<p>If R represents the full rotation matrix of the device in the earth frame XYZ, then since the initial body frame is aligned with the earth, R is as follows.
<object class="equation" data="equation13a.xhtml" type="application/mathml+xml">
<img src="equation13a.png" alt="R = ZXY = [[cos(alpha) cos(gamma)-sin(alpha) sin(beta) sin(gamma), -cos(beta) sin(alpha), cos(gamma) sin(alpha) sin(beta)+cos(alpha) sin(gamma)], [cos(gamma) sin(alpha)+cos(alpha) sin(beta) sin(gamma), cos(alpha) cos(beta), sin(alpha) sin(gamma)-cos(alpha) cos(gamma) sin(beta)], [-cos(beta) sin(gamma), sin(beta), cos(beta) cos(gamma)]]">
</object>
<p>If v' represents the vector v in the earth frame XYZ, then since the initial
body frame is aligned with the earth, v' is as follows.
<object class="equation" data="equation5a.xhtml" type="application/mathml+xml">
<img src="equation5a.png" alt="v' = Rv">
</object>
</object>
<object class="equation" data="equation5e.xhtml" type="application/mathml+xml">
<img src="equation5e.png" alt="v' = [-cos(alpha)sin(gamma)-sin(alpha)sin(beta)cos(gamma); -sin(alpha)sin(gamma)+cos(alpha)sin(beta)cos(gamma); -cos(beta)cos(gamma)]">
</object>
<p>The compass heading θ is given by
<object class="equation" data="equation6.xhtml" type="application/mathml+xml">
<img src="equation6.png" alt="theta = atan((v'_x)/(v'_y)) = atan((-cos(alpha)sin(gamma)-sin(alpha)sin(beta)cos(gamma))/(-sin(alpha)sin(gamma)+cos(alpha)sin(beta)cos(gamma)))">
</object>
<p>provided that β and γ are not both zero.
<div class="example">
<p>The compass heading calculation above can be represented in JavaScript as follows to return the correct compass heading when the provided parameters are defined, not null and represent <code>absolute</code> values.
<pre>
var degtorad = Math.PI / 180; // Degree-to-Radian conversion
function compassHeading( alpha, beta, gamma ) {
var _x = beta ? beta * degtorad : 0; // beta value
var _y = gamma ? gamma * degtorad : 0; // gamma value
var _z = alpha ? alpha * degtorad : 0; // alpha value
var cX = Math.cos( _x );
var cY = Math.cos( _y );
var cZ = Math.cos( _z );
var sX = Math.sin( _x );
var sY = Math.sin( _y );
var sZ = Math.sin( _z );
// Calculate Vx and Vy components
var Vx = - cZ * sY - sZ * sX * cY;
var Vy = - sZ * sY + cZ * sX * cY;
// Calculate compass heading
var compassHeading = Math.atan( Vx / Vy );
// Convert compass heading to use whole unit circle
if( Vy < 0 ) {
compassHeading += Math.PI;
} else if( Vx < 0 ) {
compassHeading += 2 * Math.PI;
}
return compassHeading * ( 180 / Math.PI ); // Compass Heading (in degrees)
}
</pre>
</div>
<p>As a consistency check, if we set γ = 0, then
<object class="equation" data="equation7.xhtml" type="application/mathml+xml">
<img src="equation7.png" alt="theta = atan(-sin(alpha)sin(beta)/cos(alpha)sin(beta)) = -alpha">
</object>
<p>as expected.
<p>Alternatively, if we set β = 90, then
<object class="equation" data="equation8a.xhtml" type="application/mathml+xml">
<img src="equation8a.png" alt="theta = atan((-cos(alpha)sin(gamma)-sin(alpha)cos(gamma))/(-sin(alpha)sin(gamma)+cos(alpha)cos(gamma)))">
</object>
<object class="equation" data="equation8b.xhtml" type="application/mathml+xml">
<img src="equation8b.png" alt="theta = atan(-sin(alpha+gamma)/cos(alpha+gamma)) = -(alpha+gamma)">
</object>
<p>as expected.
<h3 id="worked-example-2">A.2 Alternate device orientation representations</h3>
<p><em>This section is non-normative.</em>
<p>Describing orientation using Tait-Bryan angles can have some disadvantages such as introducing gimbal lock
<a href="#ref-gimballock">[GIMBALLOCK]</a>. Depending on the intended application it can be useful to convert
the Device Orientation values to other rotation representations.
<p>The first alternate orientation representation uses rotation matrices. By combining the component rotation matrices
provided in the <a href="#worked-example">worked example</a> above we
can represent the orientation of the device body frame as a combined rotation matrix.
<p>If R represents the rotation matrix of the device in the earth frame XYZ, then since the initial body frame is aligned with the earth, R is as follows.
<object class="equation" data="equation13a.xhtml" type="application/mathml+xml">
<img src="equation13a.png" alt="R = ZXY = [[cos(alpha) cos(gamma)-sin(alpha) sin(beta) sin(gamma), -cos(beta) sin(alpha), cos(gamma) sin(alpha) sin(beta)+cos(alpha) sin(gamma)], [cos(gamma) sin(alpha)+cos(alpha) sin(beta) sin(gamma), cos(alpha) cos(beta), sin(alpha) sin(gamma)-cos(alpha) cos(gamma) sin(beta)], [-cos(beta) sin(gamma), sin(beta), cos(beta) cos(gamma)]]">
</object>
<div class="example">
<p>The above combined rotation matrix can be represented in JavaScript as follows provided passed parameters are defined, not null and represent <code>absolute</code> values.
<pre>
var degtorad = Math.PI / 180; // Degree-to-Radian conversion
function getRotationMatrix( alpha, beta, gamma ) {
var _x = beta ? beta * degtorad : 0; // beta value
var _y = gamma ? gamma * degtorad : 0; // gamma value
var _z = alpha ? alpha * degtorad : 0; // alpha value
var cX = Math.cos( _x );
var cY = Math.cos( _y );
var cZ = Math.cos( _z );
var sX = Math.sin( _x );
var sY = Math.sin( _y );
var sZ = Math.sin( _z );
//
// ZXY rotation matrix construction.
//
var m11 = cZ * cY - sZ * sX * sY;
var m12 = - cX * sZ;
var m13 = cY * sZ * sX + cZ * sY;
var m21 = cY * sZ + cZ * sX * sY;
var m22 = cZ * cX;
var m23 = sZ * sY - cZ * cY * sX;
var m31 = - cX * sY;
var m32 = sX;
var m33 = cX * cY;
return [
m11, m12, m13,
m21, m22, m23,
m31, m32, m33
];
};
</pre>
</div>
<p>Another alternate representation of device orientation data is as Quaternions. <a href="#ref-quaternions">[QUATERNIONS]</a>
<p style="height: 240px">If q represents the unit quaternion of the device in the earth frame XYZ, then since the initial body frame is aligned with the earth, q is as follows.
<object class="equation" data="equation14.xhtml" type="application/mathml+xml">
<img src="equation14.png" alt="q = [[q_w], [q_x], [q_y], [q_z]] = [[cos(beta)cos(gamma)cos(alpha) - sin(beta)sin(gamma)sin(alpha)], [sin(beta)cos(gamma)cos(alpha) - cos(beta)sin(gamma)sin(alpha)], [cos(beta)sin(gamma)cos(alpha) + sin(beta)cos(gamma)sin(alpha)], [cos(beta)cos(gamma)sin(alpha) + sin(beta)sin(gamma)cos(alpha)]]">
</object>
<div class="example">
<p>The above quaternion can be represented in JavaScript as follows provided the passed parameters are defined, are <code>absolute</code> values and those parameters are not null.
<pre>
var degtorad = Math.PI / 180; // Degree-to-Radian conversion
function getQuaternion( alpha, beta, gamma ) {
var _x = beta ? beta * degtorad : 0; // beta value
var _y = gamma ? gamma * degtorad : 0; // gamma value
var _z = alpha ? alpha * degtorad : 0; // alpha value
var cX = Math.cos( _x/2 );
var cY = Math.cos( _y/2 );
var cZ = Math.cos( _z/2 );
var sX = Math.sin( _x/2 );
var sY = Math.sin( _y/2 );
var sZ = Math.sin( _z/2 );
//
// ZXY quaternion construction.
//
var w = cX * cY * cZ - sX * sY * sZ;
var x = sX * cY * cZ - cX * sY * sZ;
var y = cX * sY * cZ + sX * cY * sZ;
var z = cX * cY * sZ + sX * sY * cZ;
return [ w, x, y, z ];
}
</pre>
</div>
<p>We can check that a Unit Quaternion has been constructed correctly using Lagrange's four-square theorem
<object class="equation" data="equation18.xhtml" type="application/mathml+xml">
<img src="equation18.png" alt="q_w^2 * q_x^2 * q_y^2 * q_z^2 = 1">
</object>
<p>as expected.
<p>
<h2 class=no-num id="acknowledgments">Acknowledgments</h2>
<p>Lars Erik Bolstad, Dean Jackson, Claes Nilsson, George Percivall, Doug Turner, Matt Womer
<h2 class=no-num id="references">References</h2>
<dl>
<dt><a id="ref-domevents">[DOM4]</a></dt>
<dd><cite><a href="http://www.w3.org/TR/2015/REC-dom-20151119/">DOM4</a></cite>, Anne van Kesteren, et al., Editors. World Wide Web Consortium, 19 November 2015. See http://www.w3.org/TR/2015/REC-dom-20151119/</dd>
<dt><a id="ref-eulerangles">[EULERANGLES]</a></dt>
<dd><em>(Non-normative)</em> <cite><a href="http://en.wikipedia.org/wiki/Euler_angles">Euler Angles</a></cite>, See http://en.wikipedia.org/wiki/Euler_angles</dd>
<dt><a id="ref-fingerprint">[FINGERPRINT]</a></dt>
<dd><em>(Non-normative)</em> <cite><a href="http://arxiv.org/abs/1408.1416">Mobile Device Identification via Sensor Fingerprinting</a></cite>, 6 Aug 2014. See http://arxiv.org/abs/1408.1416</dd>
<dt><a id="ref-gimballock">[GIMBALLOCK]</a></dt>
<dd><em>(Non-normative)</em> <cite><a href="http://en.wikipedia.org/wiki/Gimbal_Lock">Gimbal Lock</a></cite>, See http://en.wikipedia.org/wiki/Gimbal_Lock</dd>
<dt><a id="ref-indoorpos">[INDOORPOS]</a></dt>
<dd><em>(Non-normative)</em> <cite><a href="http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A475619&dswid=9050">Indoor positioning</a></cite>, Shala, Ubejd, and Angel Rodriguez. Indoor positioning using sensor-fusion in android devices. 2011. See http://www.diva-portal.org/smash/record.jsf?pid=diva2%3A475619&dswid=9050</dd>
<dt><a id="ref-html5">[HTML51]</a></dt>
<dd><cite><a href="https://www.w3.org/TR/2016/REC-html51-20161101/">HTML 5.1</a></cite>, Steve Faulkner, et al., Editors. World Wide Web Consortium, 1 November 2016. See https://www.w3.org/TR/2016/REC-html51-20161101/</dd>
<dt><a id="ref-page-visibility">[PAGE-VISIBILITY]</a></dt>
<dd><cite><a href="https://www.w3.org/TR/page-visibility/">Page visibility level 2</a></cite>, Jatinder Mann; Arvind Jain. Page Visibility (Second Edition). 29 October 2013. REC. See https://www.w3.org/TR/page-visibility/</dd>
<dt><a id="ref-quaternions">[QUATERNIONS]</a></dt>
<dd><em>(Non-normative)</em> <cite><a href="http://en.wikipedia.org/wiki/Quaternion">Quaternions</a></cite>, See http://en.wikipedia.org/wiki/Quaternion</dd>
<dt><a id=ref-rfc2119>[RFC2119]</a></dt>
<dd><cite><a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a></cite>, Scott Bradner. Internet Engineering Task Force, March 1997. See http://www.ietf.org/rfc/rfc2119.txt</dd>
<dt><a id=ref-secure-contexts>[SECURE-CONTEXTS]</a></dt>
<dd><cite><a href="https://www.w3.org/TR/2016/CR-secure-contexts-20160915/">Secure Contexts</a></cite>, Mike West, Editor. World Wide Web Consortium, 15 September 2016. See https://www.w3.org/TR/2016/CR-secure-contexts-20160915/</dd>