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

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

Added original make3d

File size: 777 bytes
Line 
1function y = axis(x)
2% AXIS  Axis of quaternion.
3% If Q = A + mu .* B where A and B are real/complex, and mu is a unit pure
4% quaternion, then axis(Q) = mu.
5
6% Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan.
7% See the file : Copyright.m for further details.
8
9error(nargchk(1, 1, nargin)), error(nargoutchk(0, 1, nargout))
10
11% In the warning check that follows, abs is used twice in order to handle
12% complexified quaternions with a complex modulus.
13
14if any(abs(abs(v(x))) < eps)
15    warning('At least one element may have an undefined axis.');
16end
17
18% Make a unit version of x before taking the vector part. This is essential
19% in the case where x is a complex quaternion, but has no effect when x is
20% a real quaternion. SJS 20 September 2005.
21
22y = unit(v(unit(x)));
Note: See TracBrowser for help on using the repository browser.