Rev | Line | |
---|
[37] | 1 | % Test code for the quaternion sqrt function. |
---|
| 2 | |
---|
| 3 | % Copyright © 2006 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
| 4 | % See the file : Copyright.m for further details. |
---|
| 5 | |
---|
| 6 | T = 1e-13; |
---|
| 7 | |
---|
| 8 | % Test 1. Real quaternion data. |
---|
| 9 | |
---|
| 10 | q = quaternion(randn(100,100), randn(100,100), randn(100,100), randn(100,100)); |
---|
| 11 | |
---|
| 12 | compare(q, sqrt(q) .^2, T, 'quaternion/sqrt failed test 1.'); |
---|
| 13 | |
---|
| 14 | clear q |
---|
| 15 | |
---|
| 16 | % Test 2. Complex quaternion data. |
---|
| 17 | |
---|
| 18 | b = quaternion(complex(randn(100,100)),complex(randn(100,100)),... |
---|
| 19 | complex(randn(100,100)),complex(randn(100,100))); |
---|
| 20 | |
---|
| 21 | compare(b, sqrt(b) .^2, T, 'quaternion/sqrt failed test 2.'); |
---|
| 22 | |
---|
| 23 | clear b T |
---|
Note: See
TracBrowser
for help on using the repository browser.