Line | |
---|
1 | function displayall(q) |
---|
2 | % Displays the four components of a quaternion (array). |
---|
3 | |
---|
4 | % Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
5 | % See the file : Copyright.m for further details. |
---|
6 | |
---|
7 | % Note, there is no easy way to output a quaternion array in the |
---|
8 | % same format as a complex array, therefore we resort to displaying |
---|
9 | % the s, x, y, z components as real arrays. |
---|
10 | |
---|
11 | disp(' '); |
---|
12 | disp([inputname(1) ' =']); |
---|
13 | disp(' '); |
---|
14 | if ~ispure(q) |
---|
15 | disp(s(q)); |
---|
16 | disp([' + I *']); |
---|
17 | else |
---|
18 | disp([' I *']); |
---|
19 | end |
---|
20 | disp(' '); |
---|
21 | disp(x(q)); |
---|
22 | disp(' + J *'); |
---|
23 | disp(' '); |
---|
24 | disp(y(q)); |
---|
25 | disp(' + K *'); |
---|
26 | disp(' '); |
---|
27 | disp(z(q)); |
---|
Note: See
TracBrowser
for help on using the repository browser.