|
@@ -47,6 +47,7 @@ private slots:
|
47
|
47
|
|
48
|
48
|
void crossProduct1();
|
49
|
49
|
void crossProduct2();
|
|
50
|
+ void crossProduct3();
|
50
|
51
|
|
51
|
52
|
void norm1();
|
52
|
53
|
void norm2();
|
|
@@ -381,6 +382,16 @@ void TestVector3D::crossProduct2()
|
381
|
382
|
QCOMPARE(v.getZ(), -310.0);
|
382
|
383
|
}
|
383
|
384
|
|
|
385
|
+void TestVector3D::crossProduct3()
|
|
386
|
+{
|
|
387
|
+ Vector3D v1(10.0, 24.0, 8.0);
|
|
388
|
+ Vector3D v2(15.0, 5.0, 0.0);
|
|
389
|
+ Vector3D v = Vector3D::crossProduct(v1, v2);
|
|
390
|
+ QCOMPARE(v.getX(), -40.0);
|
|
391
|
+ QCOMPARE(v.getY(), 120.0);
|
|
392
|
+ QCOMPARE(v.getZ(), -310.0);
|
|
393
|
+}
|
|
394
|
+
|
384
|
395
|
void TestVector3D::norm1()
|
385
|
396
|
{
|
386
|
397
|
Vector3D v(3.0, 4.0, 0.0);;
|