mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-12 04:35:41 +08:00
Initial refactoring of vector and matrix classes
This commit is contained in:
29
samples/blackmiscvectorgeo/samplesvectormatrix.cpp
Normal file
29
samples/blackmiscvectorgeo/samplesvectormatrix.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "samplesvectormatrix.h"
|
||||
|
||||
using namespace BlackMisc::Math;
|
||||
|
||||
/*!
|
||||
* Run the samples
|
||||
*/
|
||||
int BlackMiscTest::CSamplesVectorMatrix::samples()
|
||||
{
|
||||
CVector3D v1;
|
||||
CVector3D v2(1, 2, 3);
|
||||
qDebug() << v1 << "value:" << v2[2] << v2.magnitude();
|
||||
v2 *= v2; // v2 * v2
|
||||
qDebug() << v2;
|
||||
// v2 = v1 * v1;
|
||||
|
||||
CMatrix3x3 m;
|
||||
CMatrix3x3 mr = m;
|
||||
qDebug() << m << mr;
|
||||
mr.setRandom();
|
||||
CMatrix3x3 mi = mr.inverse();
|
||||
CMatrix3x3 mid = mr * mi;
|
||||
qDebug() << mr << mi << mid;
|
||||
|
||||
// bye
|
||||
qDebug() << "-----------------------------------------------";
|
||||
return 0;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user