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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rotation (Apache Commons Math 3.6.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Rotation (Apache Commons Math 3.6.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Rotation.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" target="_top">Frames</a></li>
<li><a href="Rotation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.geometry.euclidean.threed</div>
<h2 title="Class Rotation" class="title">Class Rotation</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.geometry.euclidean.threed.Rotation</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Rotation</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">This class implements rotations in a three-dimensional space.
<p>Rotations can be represented by several different mathematical
entities (matrices, axe and angle, Cardan or Euler angles,
quaternions). This class presents an higher level abstraction, more
user-oriented and hiding this implementation details. Well, for the
curious, we use quaternions for the internal representation. The
user can build a rotation from any of these representations, and
any of these representations can be retrieved from a
<code>Rotation</code> instance (see the various constructors and
getters). In addition, a rotation can also be built implicitly
from a set of vectors and their image.</p>
<p>This implies that this class can be used to convert from one
representation to another one. For example, converting a rotation
matrix into a set of Cardan angles from can be done using the
following single line of code:</p>
<pre>
double[] angles = new Rotation(matrix, 1.0e-10).getAngles(RotationOrder.XYZ);
</pre>
<p>Focus is oriented on what a rotation <em>do</em> rather than on its
underlying representation. Once it has been built, and regardless of its
internal representation, a rotation is an <em>operator</em> which basically
transforms three dimensional <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><code>vectors</code></a> into other three
dimensional <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><code>vectors</code></a>. Depending on the application, the
meaning of these vectors may vary and the semantics of the rotation also.</p>
<p>For example in an spacecraft attitude simulation tool, users will often
consider the vectors are fixed (say the Earth direction for example) and the
frames change. The rotation transforms the coordinates of the vector in inertial
frame into the coordinates of the same vector in satellite frame. In this
case, the rotation implicitly defines the relation between the two frames.</p>
<p>Another example could be a telescope control application, where the rotation
would transform the sighting direction at rest into the desired observing
direction when the telescope is pointed towards an object of interest. In this
case the rotation transforms the direction at rest in a topocentric frame
into the sighting direction in the same topocentric frame. This implies in this
case the frame is fixed and the vector moves.</p>
<p>In many case, both approaches will be combined. In our telescope example,
we will probably also need to transform the observing direction in the topocentric
frame into the observing direction in inertial frame taking into account the observatory
location and the Earth rotation, which would essentially be an application of the
first approach.</p>
<p>These examples show that a rotation is what the user wants it to be. This
class does not push the user towards one specific definition and hence does not
provide methods like <code>projectVectorIntoDestinationFrame</code> or
<code>computeTransformedDirection</code>. It provides simpler and more generic
methods: <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)"><code>applyTo(Vector3D)</code></a> and <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)"><code>applyInverseTo(Vector3D)</code></a>.</p>
<p>Since a rotation is basically a vectorial operator, several rotations can be
composed together and the composite operation <code>r = r<sub>1</sub> o
r<sub>2</sub></code> (which means that for each vector <code>u</code>,
<code>r(u) = r<sub>1</sub>(r<sub>2</sub>(u))</code>) is also a rotation. Hence
we can consider that in addition to vectors, a rotation can be applied to other
rotations as well (or to itself). With our previous notations, we would say we
can apply <code>r<sub>1</sub></code> to <code>r<sub>2</sub></code> and the result
we get is <code>r = r<sub>1</sub> o r<sub>2</sub></code>. For this purpose, the
class provides the methods: <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)"><code>applyTo(Rotation)</code></a> and
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)"><code>applyInverseTo(Rotation)</code></a>.</p>
<p>Rotations are guaranteed to be immutable objects.</p></div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><code>Vector3D</code></a>,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><code>RotationOrder</code></a>,
<a href="../../../../../../../serialized-form.html#org.apache.commons.math3.geometry.euclidean.threed.Rotation">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#IDENTITY">IDENTITY</a></strong></code>
<div class="block">Identity rotation.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(double[][],%20double)">Rotation</a></strong>(double[][] m,
double threshold)</code>
<div class="block">Build a rotation from a 3X3 matrix.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(double,%20double,%20double,%20double,%20boolean)">Rotation</a></strong>(double q0,
double q1,
double q2,
double q3,
boolean needsNormalization)</code>
<div class="block">Build a rotation from the quaternion coordinates.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20double,%20double,%20double)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
double alpha1,
double alpha2,
double alpha3)</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention,%20double,%20double,%20double)"><code>Rotation(RotationOrder, RotationConvention, double, double, double)</code></a></i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention,%20double,%20double,%20double)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention,
double alpha1,
double alpha2,
double alpha3)</code>
<div class="block">Build a rotation from three Cardan or Euler elementary rotations.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> axis,
double angle)</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>Rotation(Vector3D, double, RotationConvention)</code></a></i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> axis,
double angle,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</code>
<div class="block">Build a rotation from an axis and an angle.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v)</code>
<div class="block">Build one of the rotations that transform one vector into another one.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">Rotation</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u2,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v2)</code>
<div class="block">Build the rotation that transforms a pair of vectors into another pair.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyInverseTo(double[],%20double[])">applyInverseTo</a></strong>(double[] in,
double[] out)</code>
<div class="block">Apply the inverse of the rotation to a vector stored in an array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)">applyInverseTo</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r)</code>
<div class="block">Apply the inverse of the instance to another rotation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">applyInverseTo</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u)</code>
<div class="block">Apply the inverse of the rotation to a vector.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyTo(double[],%20double[])">applyTo</a></strong>(double[] in,
double[] out)</code>
<div class="block">Apply the rotation to a vector stored in an array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)">applyTo</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r)</code>
<div class="block">Apply the instance to another rotation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#applyTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">applyTo</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u)</code>
<div class="block">Apply the rotation to a vector.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#compose(org.apache.commons.math3.geometry.euclidean.threed.Rotation,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">compose</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</code>
<div class="block">Compose the instance with another rotation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#composeInverse(org.apache.commons.math3.geometry.euclidean.threed.Rotation,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">composeInverse</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</code>
<div class="block">Compose the inverse of the instance with another rotation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#distance(org.apache.commons.math3.geometry.euclidean.threed.Rotation,%20org.apache.commons.math3.geometry.euclidean.threed.Rotation)">distance</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r2)</code>
<div class="block">Compute the <i>distance</i> between two rotations.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngle()">getAngle</a></strong>()</code>
<div class="block">Get the angle of the rotation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder)">getAngles</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order)</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAngles(RotationOrder, RotationConvention)</code></a></i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">getAngles</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</code>
<div class="block">Get the Cardan or Euler angles corresponding to the instance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAxis()">getAxis</a></strong>()</code>
<div class="block"><strong>Deprecated.</strong>
<div class="block"><i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAxis(org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAxis(RotationConvention)</code></a></i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAxis(org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">getAxis</a></strong>(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</code>
<div class="block">Get the normalized axis of the rotation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double[][]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getMatrix()">getMatrix</a></strong>()</code>
<div class="block">Get the 3X3 matrix corresponding to the instance</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getQ0()">getQ0</a></strong>()</code>
<div class="block">Get the scalar coordinate of the quaternion.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getQ1()">getQ1</a></strong>()</code>
<div class="block">Get the first coordinate of the vectorial part of the quaternion.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getQ2()">getQ2</a></strong>()</code>
<div class="block">Get the second coordinate of the vectorial part of the quaternion.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getQ3()">getQ3</a></strong>()</code>
<div class="block">Get the third coordinate of the vectorial part of the quaternion.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#revert()">revert</a></strong>()</code>
<div class="block">Revert a rotation.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="IDENTITY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>IDENTITY</h4>
<pre>public static final <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> IDENTITY</pre>
<div class="block">Identity rotation.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Rotation(double, double, double, double, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(double q0,
double q1,
double q2,
double q3,
boolean needsNormalization)</pre>
<div class="block">Build a rotation from the quaternion coordinates.
<p>A rotation can be built from a <em>normalized</em> quaternion,
i.e. a quaternion for which q<sub>0</sub><sup>2</sup> +
q<sub>1</sub><sup>2</sup> + q<sub>2</sub><sup>2</sup> +
q<sub>3</sub><sup>2</sup> = 1. If the quaternion is not normalized,
the constructor can normalize it in a preprocessing step.</p>
<p>Note that some conventions put the scalar part of the quaternion
as the 4<sup>th</sup> component and the vector part as the first three
components. This is <em>not</em> our convention. We put the scalar part
as the first component.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>q0</code> - scalar part of the quaternion</dd><dd><code>q1</code> - first coordinate of the vectorial part of the quaternion</dd><dd><code>q2</code> - second coordinate of the vectorial part of the quaternion</dd><dd><code>q3</code> - third coordinate of the vectorial part of the quaternion</dd><dd><code>needsNormalization</code> - if true, the coordinates are considered
not to be normalized, a normalization preprocessing step is performed
before using them</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> axis,
double angle)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>Rotation(Vector3D, double, RotationConvention)</code></a></i></div>
<div class="block">Build a rotation from an axis and an angle.
<p>
Calling this constructor is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>new Rotation(axis, angle, RotationConvention.VECTOR_OPERATOR)</code></a>
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>axis</code> - axis around which to rotate</dd><dd><code>angle</code> - rotation angle.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if the axis norm is zero</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D, double, org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> axis,
double angle,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></pre>
<div class="block">Build a rotation from an axis and an angle.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>axis</code> - axis around which to rotate</dd><dd><code>angle</code> - rotation angle</dd><dd><code>convention</code> - convention to use for the semantics of the angle</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathIllegalArgumentException.html" title="class in org.apache.commons.math3.exception">MathIllegalArgumentException</a></code> - if the axis norm is zero</dd><dt><span class="strong">Since:</span></dt>
<dd>3.6</dd></dl>
</li>
</ul>
<a name="Rotation(double[][], double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(double[][] m,
double threshold)
throws <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/NotARotationMatrixException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">NotARotationMatrixException</a></pre>
<div class="block">Build a rotation from a 3X3 matrix.
<p>Rotation matrices are orthogonal matrices, i.e. unit matrices
(which are matrices for which m.m<sup>T</sup> = I) with real
coefficients. The module of the determinant of unit matrices is
1, among the orthogonal 3X3 matrices, only the ones having a
positive determinant (+1) are rotation matrices.</p>
<p>When a rotation is defined by a matrix with truncated values
(typically when it is extracted from a technical sheet where only
four to five significant digits are available), the matrix is not
orthogonal anymore. This constructor handles this case
transparently by using a copy of the given matrix and applying a
correction to the copy in order to perfect its orthogonality. If
the Frobenius norm of the correction needed is above the given
threshold, then the matrix is considered to be too far from a
true rotation matrix and an exception is thrown.<p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>m</code> - rotation matrix</dd><dd><code>threshold</code> - convergence threshold for the iterative
orthogonality correction (convergence is reached when the
difference between two steps of the Frobenius norm of the
correction is below this threshold)</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/NotARotationMatrixException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">NotARotationMatrixException</a></code> - if the matrix is not a 3X3
matrix, or if it cannot be transformed into an orthogonal matrix
with the given threshold, or if the determinant of the resulting
orthogonal matrix is negative</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D, org.apache.commons.math3.geometry.euclidean.threed.Vector3D, org.apache.commons.math3.geometry.euclidean.threed.Vector3D, org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u2,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v2)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre>
<div class="block">Build the rotation that transforms a pair of vectors into another pair.
<p>Except for possible scale factors, if the instance were applied to
the pair (u<sub>1</sub>, u<sub>2</sub>) it will produce the pair
(v<sub>1</sub>, v<sub>2</sub>).</p>
<p>If the angular separation between u<sub>1</sub> and u<sub>2</sub> is
not the same as the angular separation between v<sub>1</sub> and
v<sub>2</sub>, then a corrected v'<sub>2</sub> will be used rather than
v<sub>2</sub>, the corrected vector will be in the (±v<sub>1</sub>,
+v<sub>2</sub>) half-plane.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>u1</code> - first vector of the origin pair</dd><dd><code>u2</code> - second vector of the origin pair</dd><dd><code>v1</code> - desired image of u1 by the rotation</dd><dd><code>v2</code> - desired image of u2 by the rotation</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if the norm of one of the vectors is zero,
or if one of the pair is degenerated (i.e. the vectors of the pair are collinear)</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D, org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> v)
throws <a href="../../../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre>
<div class="block">Build one of the rotations that transform one vector into another one.
<p>Except for a possible scale factor, if the instance were
applied to the vector u it will produce the vector v. There is an
infinite number of such rotations, this constructor choose the
one with the smallest associated angle (i.e. the one whose axis
is orthogonal to the (u, v) plane). If u and v are collinear, an
arbitrary rotation axis is chosen.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>u</code> - origin vector</dd><dd><code>v</code> - desired image of u by the rotation</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if the norm of one of the vectors is zero</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder, double, double, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Rotation</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
double alpha1,
double alpha2,
double alpha3)</pre>
<div class="block"><span class="strong">Deprecated.</span> <i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention,%20double,%20double,%20double)"><code>Rotation(RotationOrder, RotationConvention, double, double, double)</code></a></i></div>
<div class="block">Build a rotation from three Cardan or Euler elementary rotations.
<p>
Calling this constructor is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention,%20double,%20double,%20double)"><code>new Rotation(order, RotationConvention.VECTOR_OPERATOR, alpha1, alpha2, alpha3)</code></a>
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>order</code> - order of rotations to use</dd><dd><code>alpha1</code> - angle of the first elementary rotation</dd><dd><code>alpha2</code> - angle of the second elementary rotation</dd><dd><code>alpha3</code> - angle of the third elementary rotation</dd></dl>
</li>
</ul>
<a name="Rotation(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder, org.apache.commons.math3.geometry.euclidean.threed.RotationConvention, double, double, double)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Rotation</h4>
<pre>public Rotation(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention,
double alpha1,
double alpha2,
double alpha3)</pre>
<div class="block">Build a rotation from three Cardan or Euler elementary rotations.
<p>Cardan rotations are three successive rotations around the
canonical axes X, Y and Z, each axis being used once. There are
6 such sets of rotations (XYZ, XZY, YXZ, YZX, ZXY and ZYX). Euler
rotations are three successive rotations around the canonical
axes X, Y and Z, the first and last rotations being around the
same axis. There are 6 such sets of rotations (XYX, XZX, YXY,
YZY, ZXZ and ZYZ), the most popular one being ZXZ.</p>
<p>Beware that many people routinely use the term Euler angles even
for what really are Cardan angles (this confusion is especially
widespread in the aerospace business where Roll, Pitch and Yaw angles
are often wrongly tagged as Euler angles).</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>order</code> - order of rotations to compose, from left to right
(i.e. we will use <code>r1.compose(r2.compose(r3, convention), convention)</code>)</dd><dd><code>convention</code> - convention to use for the semantics of the angle</dd><dd><code>alpha1</code> - angle of the first elementary rotation</dd><dd><code>alpha2</code> - angle of the second elementary rotation</dd><dd><code>alpha3</code> - angle of the third elementary rotation</dd><dt><span class="strong">Since:</span></dt>
<dd>3.6</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="revert()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>revert</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> revert()</pre>
<div class="block">Revert a rotation.
Build a rotation which reverse the effect of another
rotation. This means that if r(u) = v, then r.revert(v) = u. The
instance is not changed.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a new rotation whose effect is the reverse of the effect
of the instance</dd></dl>
</li>
</ul>
<a name="getQ0()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQ0</h4>
<pre>public double getQ0()</pre>
<div class="block">Get the scalar coordinate of the quaternion.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>scalar coordinate of the quaternion</dd></dl>
</li>
</ul>
<a name="getQ1()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQ1</h4>
<pre>public double getQ1()</pre>
<div class="block">Get the first coordinate of the vectorial part of the quaternion.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>first coordinate of the vectorial part of the quaternion</dd></dl>
</li>
</ul>
<a name="getQ2()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQ2</h4>
<pre>public double getQ2()</pre>
<div class="block">Get the second coordinate of the vectorial part of the quaternion.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>second coordinate of the vectorial part of the quaternion</dd></dl>
</li>
</ul>
<a name="getQ3()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQ3</h4>
<pre>public double getQ3()</pre>
<div class="block">Get the third coordinate of the vectorial part of the quaternion.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>third coordinate of the vectorial part of the quaternion</dd></dl>
</li>
</ul>
<a name="getAxis()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAxis</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> getAxis()</pre>
<div class="block"><span class="strong">Deprecated.</span> <i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAxis(org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAxis(RotationConvention)</code></a></i></div>
<div class="block">Get the normalized axis of the rotation.
<p>
Calling this method is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAxis(org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAxis(RotationConvention.VECTOR_OPERATOR)</code></a>
</p></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>normalized axis of the rotation</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>Rotation(Vector3D, double, RotationConvention)</code></a></dd></dl>
</li>
</ul>
<a name="getAxis(org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAxis</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> getAxis(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</pre>
<div class="block">Get the normalized axis of the rotation.
<p>
Note that as <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngle()"><code>getAngle()</code></a> always returns an angle
between 0 and π, changing the convention changes the
direction of the axis, not the sign of the angle.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>convention</code> - convention to use for the semantics of the angle</dd>
<dt><span class="strong">Returns:</span></dt><dd>normalized axis of the rotation</dd><dt><span class="strong">Since:</span></dt>
<dd>3.6</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>Rotation(Vector3D, double, RotationConvention)</code></a></dd></dl>
</li>
</ul>
<a name="getAngle()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngle</h4>
<pre>public double getAngle()</pre>
<div class="block">Get the angle of the rotation.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>angle of the rotation (between 0 and π)</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#Rotation(org.apache.commons.math3.geometry.euclidean.threed.Vector3D,%20double)"><code>Rotation(Vector3D, double)</code></a></dd></dl>
</li>
</ul>
<a name="getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngles</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
public double[] getAngles(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order)
throws <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/CardanEulerSingularityException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">CardanEulerSingularityException</a></pre>
<div class="block"><span class="strong">Deprecated.</span> <i>as of 3.6, replaced with <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAngles(RotationOrder, RotationConvention)</code></a></i></div>
<div class="block">Get the Cardan or Euler angles corresponding to the instance.
<p>
Calling this method is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>getAngles(order, RotationConvention.VECTOR_OPERATOR)</code></a>
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>order</code> - rotation order to use</dd>
<dt><span class="strong">Returns:</span></dt><dd>an array of three angles, in the order specified by the set</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/CardanEulerSingularityException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">CardanEulerSingularityException</a></code> - if the rotation is
singular with respect to the angles set specified</dd></dl>
</li>
</ul>
<a name="getAngles(org.apache.commons.math3.geometry.euclidean.threed.RotationOrder, org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAngles</h4>
<pre>public double[] getAngles(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationOrder.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">RotationOrder</a> order,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)
throws <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/CardanEulerSingularityException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">CardanEulerSingularityException</a></pre>
<div class="block">Get the Cardan or Euler angles corresponding to the instance.
<p>The equations show that each rotation can be defined by two
different values of the Cardan or Euler angles set. For example
if Cardan angles are used, the rotation defined by the angles
a<sub>1</sub>, a<sub>2</sub> and a<sub>3</sub> is the same as
the rotation defined by the angles π + a<sub>1</sub>, π
- a<sub>2</sub> and π + a<sub>3</sub>. This method implements
the following arbitrary choices:</p>
<ul>
<li>for Cardan angles, the chosen set is the one for which the
second angle is between -π/2 and π/2 (i.e its cosine is
positive),</li>
<li>for Euler angles, the chosen set is the one for which the
second angle is between 0 and π (i.e its sine is positive).</li>
</ul>
<p>Cardan and Euler angle have a very disappointing drawback: all
of them have singularities. This means that if the instance is
too close to the singularities corresponding to the given
rotation order, it will be impossible to retrieve the angles. For
Cardan angles, this is often called gimbal lock. There is
<em>nothing</em> to do to prevent this, it is an intrinsic problem
with Cardan and Euler representation (but not a problem with the
rotation itself, which is perfectly well defined). For Cardan
angles, singularities occur when the second angle is close to
-π/2 or +π/2, for Euler angle singularities occur when the
second angle is close to 0 or π, this implies that the identity
rotation is always singular for Euler angles!</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>order</code> - rotation order to use</dd><dd><code>convention</code> - convention to use for the semantics of the angle</dd>
<dt><span class="strong">Returns:</span></dt><dd>an array of three angles, in the order specified by the set</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/CardanEulerSingularityException.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">CardanEulerSingularityException</a></code> - if the rotation is
singular with respect to the angles set specified</dd><dt><span class="strong">Since:</span></dt>
<dd>3.6</dd></dl>
</li>
</ul>
<a name="getMatrix()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMatrix</h4>
<pre>public double[][] getMatrix()</pre>
<div class="block">Get the 3X3 matrix corresponding to the instance</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the matrix corresponding to the instance</dd></dl>
</li>
</ul>
<a name="applyTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyTo</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> applyTo(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u)</pre>
<div class="block">Apply the rotation to a vector.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>u</code> - vector to apply the rotation to</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new vector which is the image of u by the rotation</dd></dl>
</li>
</ul>
<a name="applyTo(double[], double[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyTo</h4>
<pre>public void applyTo(double[] in,
double[] out)</pre>
<div class="block">Apply the rotation to a vector stored in an array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - an array with three items which stores vector to rotate</dd><dd><code>out</code> - an array with three items to put result to (it can be the same
array as in)</dd></dl>
</li>
</ul>
<a name="applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyInverseTo</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> applyInverseTo(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Vector3D.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Vector3D</a> u)</pre>
<div class="block">Apply the inverse of the rotation to a vector.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>u</code> - vector to apply the inverse of the rotation to</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new vector which such that u is its image by the rotation</dd></dl>
</li>
</ul>
<a name="applyInverseTo(double[], double[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyInverseTo</h4>
<pre>public void applyInverseTo(double[] in,
double[] out)</pre>
<div class="block">Apply the inverse of the rotation to a vector stored in an array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>in</code> - an array with three items which stores vector to rotate</dd><dd><code>out</code> - an array with three items to put result to (it can be the same
array as in)</dd></dl>
</li>
</ul>
<a name="applyTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyTo</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> applyTo(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r)</pre>
<div class="block">Apply the instance to another rotation.
<p>
Calling this method is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#compose(org.apache.commons.math3.geometry.euclidean.threed.Rotation,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>compose(r, RotationConvention.VECTOR_OPERATOR)</code></a>.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - rotation to apply the rotation to</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new rotation which is the composition of r by the instance</dd></dl>
</li>
</ul>
<a name="compose(org.apache.commons.math3.geometry.euclidean.threed.Rotation, org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>compose</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> compose(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</pre>
<div class="block">Compose the instance with another rotation.
<p>
If the semantics of the rotations composition corresponds to a
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html#VECTOR_OPERATOR"><code>vector operator</code></a> convention,
applying the instance to a rotation is computing the composition
in an order compliant with the following rule : let <code>u</code> be any
vector and <code>v</code> its image by <code>r1</code> (i.e.
<code>r1.applyTo(u) = v</code>). Let <code>w</code> be the image of <code>v</code> by
rotation <code>r2</code> (i.e. <code>r2.applyTo(v) = w</code>). Then
<code>w = comp.applyTo(u)</code>, where
<code>comp = r2.compose(r1, RotationConvention.VECTOR_OPERATOR)</code>.
</p>
<p>
If the semantics of the rotations composition corresponds to a
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html#FRAME_TRANSFORM"><code>frame transform</code></a> convention,
the application order will be reversed. So keeping the exact same
meaning of all <code>r1</code>, <code>r2</code>, <code>u</code>, <code>v</code>, <code>w</code>
and <code>comp</code> as above, <code>comp</code> could also be computed as
<code>comp = r1.compose(r2, RotationConvention.FRAME_TRANSFORM)</code>.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - rotation to apply the rotation to</dd><dd><code>convention</code> - convention to use for the semantics of the angle</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new rotation which is the composition of r by the instance</dd></dl>
</li>
</ul>
<a name="applyInverseTo(org.apache.commons.math3.geometry.euclidean.threed.Rotation)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>applyInverseTo</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> applyInverseTo(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r)</pre>
<div class="block">Apply the inverse of the instance to another rotation.
<p>
Calling this method is equivalent to call
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html#composeInverse(org.apache.commons.math3.geometry.euclidean.threed.Rotation,%20org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)"><code>composeInverse(r, RotationConvention.VECTOR_OPERATOR)</code></a>.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - rotation to apply the rotation to</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new rotation which is the composition of r by the inverse
of the instance</dd></dl>
</li>
</ul>
<a name="composeInverse(org.apache.commons.math3.geometry.euclidean.threed.Rotation, org.apache.commons.math3.geometry.euclidean.threed.RotationConvention)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>composeInverse</h4>
<pre>public <a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> composeInverse(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed">RotationConvention</a> convention)</pre>
<div class="block">Compose the inverse of the instance with another rotation.
<p>
If the semantics of the rotations composition corresponds to a
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html#VECTOR_OPERATOR"><code>vector operator</code></a> convention,
applying the inverse of the instance to a rotation is computing
the composition in an order compliant with the following rule :
let <code>u</code> be any vector and <code>v</code> its image by <code>r1</code>
(i.e. <code>r1.applyTo(u) = v</code>). Let <code>w</code> be the inverse image
of <code>v</code> by <code>r2</code> (i.e. <code>r2.applyInverseTo(v) = w</code>).
Then <code>w = comp.applyTo(u)</code>, where
<code>comp = r2.composeInverse(r1)</code>.
</p>
<p>
If the semantics of the rotations composition corresponds to a
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html#FRAME_TRANSFORM"><code>frame transform</code></a> convention,
the application order will be reversed, which means it is the
<em>innermost</em> rotation that will be reversed. So keeping the exact same
meaning of all <code>r1</code>, <code>r2</code>, <code>u</code>, <code>v</code>, <code>w</code>
and <code>comp</code> as above, <code>comp</code> could also be computed as
<code>comp = r1.revert().composeInverse(r2.revert(), RotationConvention.FRAME_TRANSFORM)</code>.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - rotation to apply the rotation to</dd><dd><code>convention</code> - convention to use for the semantics of the angle</dd>
<dt><span class="strong">Returns:</span></dt><dd>a new rotation which is the composition of r by the inverse
of the instance</dd></dl>
</li>
</ul>
<a name="distance(org.apache.commons.math3.geometry.euclidean.threed.Rotation, org.apache.commons.math3.geometry.euclidean.threed.Rotation)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>distance</h4>
<pre>public static double distance(<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r1,
<a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" title="class in org.apache.commons.math3.geometry.euclidean.threed">Rotation</a> r2)</pre>
<div class="block">Compute the <i>distance</i> between two rotations.
<p>The <i>distance</i> is intended here as a way to check if two
rotations are almost similar (i.e. they transform vectors the same way)
or very different. It is mathematically defined as the angle of
the rotation r that prepended to one of the rotations gives the other
one:</p>
<pre>
r<sub>1</sub>(r) = r<sub>2</sub>
</pre>
<p>This distance is an angle between 0 and π. Its value is the smallest
possible upper bound of the angle in radians between r<sub>1</sub>(v)
and r<sub>2</sub>(v) for all possible vectors v. This upper bound is
reached for some v. The distance is equal to 0 if and only if the two
rotations are identical.</p>
<p>Comparing two rotations should always be done using this value rather
than for example comparing the components of the quaternions. It is much
more stable, and has a geometric meaning. Also comparing quaternions
components is error prone since for example quaternions (0.36, 0.48, -0.48, -0.64)
and (-0.36, -0.48, 0.48, 0.64) represent exactly the same rotation despite
their components are different (they are exact opposites).</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r1</code> - first rotation</dd><dd><code>r2</code> - second rotation</dd>
<dt><span class="strong">Returns:</span></dt><dd><i>distance</i> between r1 and r2</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Rotation.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet.html" title="class in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../../../org/apache/commons/math3/geometry/euclidean/threed/RotationConvention.html" title="enum in org.apache.commons.math3.geometry.euclidean.threed"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/commons/math3/geometry/euclidean/threed/Rotation.html" target="_top">Frames</a></li>
<li><a href="Rotation.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field_summary">Field</a> | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field_detail">Field</a> | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2003–2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
|