Line | |
---|
1 | % Test code for the quaternion exponential function. This also tests the |
---|
2 | % axis, modulus, and unit functions as well as many others. |
---|
3 | |
---|
4 | % Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
5 | % See the file : Copyright.m for further details. |
---|
6 | |
---|
7 | T = 1e-13; |
---|
8 | |
---|
9 | % Test 1. Real quaternion data. |
---|
10 | |
---|
11 | q = quaternion(randn(100,100), randn(100,100), randn(100,100), randn(100,100)); |
---|
12 | |
---|
13 | compare(q, abs(q) .* exp(axis(q) .* angle(q)), T, 'quaternion/exp failed test 1.'); |
---|
14 | |
---|
15 | % Test 2. Complex quaternion data. |
---|
16 | |
---|
17 | b = complex(q, quaternion(randn(100,100), randn(100,100), randn(100,100), randn(100,100))); |
---|
18 | |
---|
19 | compare(b, abs(b) .* exp(axis(b) .* angle(b)), T, 'quaternion/exp failed test 2.'); |
---|
20 | |
---|
21 | clear q b T |
---|
Note: See
TracBrowser
for help on using the repository browser.