Line | |
---|
1 | function x = ess(q) |
---|
2 | % Extracts the scalar component of a full quaternion. If q is a pure |
---|
3 | % quaternion, an error is raised, since the scalar part of a pure |
---|
4 | % quaternion should not be extracted. |
---|
5 | |
---|
6 | % Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan. |
---|
7 | % See the file : Copyright.m for further details. |
---|
8 | |
---|
9 | % error(nargchk(1, 1, nargin)), error(nargoutchk(0, 1, nargout)) |
---|
10 | |
---|
11 | if isempty(q.w) |
---|
12 | error('The scalar part of a pure quaternion is not defined.'); |
---|
13 | end |
---|
14 | |
---|
15 | x = q.w; |
---|
Note: See
TracBrowser
for help on using the repository browser.