source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/qtfm/@quaternion/scalar.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 549 bytes
Line 
1function x = scalar(q)
2% SCALAR   Quaternion scalar part.
3%
4% This function returns zero in the case of pure quaternions,
5% whereas the function S gives an error if q is pure.
6
7% Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan.
8% See the file : Copyright.m for further details.
9
10error(nargchk(1, 1, nargin)), error(nargoutchk(0, 1, nargout))
11
12% A possible problem here: zeros will return a double array
13% and if Q has some other type, the result will not be of the
14% same type.
15
16if ispure(q)
17    x = zeros(size(q));
18else
19    x = s(q);
20end
Note: See TracBrowser for help on using the repository browser.