Menu

[r136]: / trunk / test / quaternion / main.cpp  Maximize  Restore  History

Download this file

30 lines (23 with data), 757 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "cpplapack.h"
//=============================================================================
/*! main */
int main(int argc, char** argv)
{
CPPL::dquater q( vt2q(CPPL::dcovec3(1,1,1),M_PI/3.) );
std::cout << t(q) << std::endl;
std::cout << t(q*inv(q)) << std::endl;
std::cout << q2m(q) << std::endl;
//// dcovec3 ////
std::cout << t(rotate(CPPL::dcovec3(1,0,0),q)) << std::flush;
std::cout << t(rotate(CPPL::dcovec3(0,1,0),q)) << std::flush;
std::cout << t(rotate(CPPL::dcovec3(0,0,1),q)) << std::flush;
//// dgemat3 ////
CPPL::dgemat3 gm;
gm.identity();
std::cout << rotate(gm,q) << std::endl;
//// dsymat3 ////
CPPL::dsymat3 sm;
sm.identity();
std::cout << rotate(sm,q) << std::endl;
return 0;
}
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.