core/vnl/vnl_double_3.h
Go to the documentation of this file.
00001 // This is core/vnl/vnl_double_3.h
00002 #ifndef vnl_double_3_h_
00003 #define vnl_double_3_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Contains class vnl_double_3 and function vnl_cross_3d()
00010 // \author Andrew W. Fitzgibbon, Oxford RRG
00011 // \date   31 Dec 96
00012 //
00013 // \verbatim
00014 //  Modifications
00015 //   Peter Vanroose, 25 June 1999: vnl_vector_fixed<double,3> already instantiated
00016 //   Peter Vanroose, 28 Mar. 2004: renamed cross_3d() to vnl_cross_3d()
00017 //   Peter Vanroose, 24 Mar. 2007: removed deprecated cross_3d() alias
00018 // \endverbatim
00019 
00020 #include <vnl/vnl_T_n.h>
00021 
00022 //: class vnl_double_3 : a vnl_vector of 3 doubles.
00023 vnl_T_n_impl(double,3);
00024 
00025 //: Cross product of two 3-vectors
00026 //  \relatesalso vnl_vector_fixed
00027 inline
00028 vnl_double_3 vnl_cross_3d(vnl_double_3 const& v1, vnl_double_3 const& v2)
00029 {
00030   vnl_double_3 result;
00031   result[0] = v1[1] * v2[2] - v1[2] * v2[1];
00032   result[1] = v1[2] * v2[0] - v1[0] * v2[2];
00033   result[2] = v1[0] * v2[1] - v1[1] * v2[0];
00034   return result;
00035 }
00036 
00037 #endif // vnl_double_3_h_