Rev | Line | |
---|
[37] | 1 | % Test code for the quaternion log function. This also tests the |
---|
| 2 | % exponential function. |
---|
| 3 | |
---|
| 4 | % Copyright © 2006 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, exp(log(q)), T, 'quaternion/log failed test 1.'); |
---|
| 14 | |
---|
| 15 | clear q |
---|
| 16 | |
---|
| 17 | % Test 2. Complex quaternion data. |
---|
| 18 | |
---|
| 19 | b = quaternion(complex(randn(100,100)),complex(randn(100,100)),... |
---|
| 20 | complex(randn(100,100)),complex(randn(100,100))); |
---|
| 21 | |
---|
| 22 | compare(b, exp(log(b)), T, 'quaternion/log failed test 2.'); |
---|
| 23 | |
---|
| 24 | clear b T |
---|
Note: See
TracBrowser
for help on using the repository browser.