Line | |
---|
1 | % Test code for the quaternion sin and cos functions. |
---|
2 | |
---|
3 | % Copyright © 2006 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
4 | % See the file : Copyright.m for further details. |
---|
5 | |
---|
6 | T = 1e-11; |
---|
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(sin(q).^2 + cos(q).^2, ones(100,100), T,... |
---|
13 | 'quaternion/sin/cos 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(sin(b).^2 + cos(b).^2, ones(100,100), T,... |
---|
23 | 'quaternion/sin/cos failed test 2.'); |
---|
24 | |
---|
25 | clear b T |
---|
Note: See
TracBrowser
for help on using the repository browser.