Menu

[r191]: / trunk / include / small / drovector_small-specialized.hpp  Maximize  Restore  History

Download this file

25 lines (22 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//=============================================================================
/*! calculate vector product for 2D vector */
inline double operator/(const drovec2& A, const drovec2& B)
{CPPL_VERBOSE_REPORT;
return A(0)*B(1)-A(1)*B(0);
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//=============================================================================
/*! calculate vector product only for 3D vector */
inline drovec3 operator/(const drovec3& A, const drovec3& B)
{CPPL_VERBOSE_REPORT;
drovec3 C;
C(0) =A(1)*B(2) -A(2)*B(1);
C(1) =A(2)*B(0) -A(0)*B(2);
C(2) =A(0)*B(1) -A(1)*B(0);
return C;
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.