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

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

Added original make3d

File size: 565 bytes
Line 
1function c = cross(a, b)
2% CROSS (vector) product of two pure quaternions.
3
4% Copyright © 2005 Stephen J. Sangwine and Nicolas Le Bihan.
5% See the file : Copyright.m for further details.
6
7if ~isa(a, 'quaternion') | ~isa(b, 'quaternion')
8    error('Cross product is not defined for a quaternion and a non-quaternion.')
9end
10
11if ~ispure(a) | ~ispure(b)
12    error('Cross product is defined only for pure quaternions.')
13end
14
15c = quaternion(y(a) .* z(b) - z(a) .* y(b),   ...
16               z(a) .* x(b) - x(a) .* z(b),   ...
17               x(a) .* y(b) - y(a) .* x(b));
Note: See TracBrowser for help on using the repository browser.