vnl_double_3.h
Go to the documentation of this file.
1 // This is core/vnl/vnl_double_3.h
2 #ifndef vnl_double_3_h_
3 #define vnl_double_3_h_
4 //:
5 // \file
6 // \brief Contains class vnl_double_3 and function vnl_cross_3d()
7 // \author Andrew W. Fitzgibbon, Oxford RRG
8 // \date 31 Dec 96
9 //
10 // \verbatim
11 // Modifications
12 // Peter Vanroose, 25 June 1999: vnl_vector_fixed<double,3> already instantiated
13 // Peter Vanroose, 28 Mar. 2004: renamed cross_3d() to vnl_cross_3d()
14 // Peter Vanroose, 24 Mar. 2007: removed deprecated cross_3d() alias
15 // \endverbatim
16 
17 #include <vnl/vnl_T_n.h>
18 
19 //: class vnl_double_3 : a vnl_vector of 3 doubles.
20 vnl_T_n_impl(double,3);
21 
22 //: Cross product of two 3-vectors
23 // \relatesalso vnl_vector_fixed
24 inline
25 vnl_double_3 vnl_cross_3d(vnl_double_3 const& v1, vnl_double_3 const& v2)
26 {
27  vnl_double_3 result;
28  result[0] = v1[1] * v2[2] - v1[2] * v2[1];
29  result[1] = v1[2] * v2[0] - v1[0] * v2[2];
30  result[2] = v1[0] * v2[1] - v1[1] * v2[0];
31  return result;
32 }
33 
34 #endif // vnl_double_3_h_
vnl_T_n_impl(double, 3)
class vnl_double_3 : a vnl_vector of 3 doubles.
vnl_vector< T > vnl_cross_3d(const vnl_vector< T > &v1, const vnl_vector< T > &v2)
Compute the 3-D cross product.
Definition: vnl_cross.h:65