KWStyle - itkVector.cxx
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkVector.cxx.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:49 $
7   Version:   $Revision: 1.4 $
8
9   Copyright (c) Insight Software Consortium. All rights reserved.
10   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notices for more information.
15
16 DEF =========================================================================*/
17 #include "itkVector.h" 
18 #include "itkNumericTraits.h" 
19
20 namespace itk
21 {
22
23
24 /**
25  *  Methods specialized by dimension
26  *
27  *  Limitations of VC++ on partial specialization 
28  *  force us to define the following method for
29  *  a set of types.
30  */
31
32
33 Vector<double,3>
34 LEN ITKCommon_EXPORT CrossProduct( const Vector<double,3> & a, const Vector<double,3> & b ) 
35 {
36   Vector<double,3> c;
37   c[0] = a[1] * b[2] - a[2] * b[1];
38   c[1] = a[2] * b[0] - a[0] * b[2];
39   c[2] = a[0] * b[1] - a[1] * b[0];
40   return c;  
41 }
42
43
44 Vector<float,3>
45 LEN ITKCommon_EXPORT CrossProduct( const Vector<float,3> & a, const Vector<float,3> & b ) 
46 {
47   Vector<float,3> c;
48   c[0] = a[1] * b[2] - a[2] * b[1];
49   c[1] = a[2] * b[0] - a[0] * b[2];
50   c[2] = a[0] * b[1] - a[1] * b[0];
51   return c;  
52 }
53
54
55 Vector<int,3>
56 LEN ITKCommon_EXPORT CrossProduct( const Vector<int,3> & a, const Vector<int,3> & b ) 
57 {
58   Vector<int,3> c;
59   c[0] = a[1] * b[2] - a[2] * b[1];
60   c[1] = a[2] * b[0] - a[0] * b[2];
61   c[2] = a[0] * b[1] - a[1] * b[0];
62   return c;  
63 }
64
65
66 EML
67 EML
68 EML
69 // end namespace itk
70
71 EOF
72 EOF,EML

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:52PM
© Kitware Inc.