1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-07-31 12:00:23 +02:00
This commit is contained in:
Justin Lin
2022-05-05 08:41:27 +08:00
parent 659988abe2
commit cb03a1437b
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
use <unittest.scad>;
use <matrix/m_rotation.scad>;
module test_m_rotation() {
echo("==== test_m_rotation ====");
a = [0, -45, 45];
expected = [[0.5, -0.707107, -0.5, 0], [0.5, 0.707107, -0.5, 0], [0.707107, 0, 0.707107, 0], [0, 0, 0, 1]];
actual = m_rotation(a);
assertEqualPoints(expected, actual, 0.0005);
v = [10, 10, 10];
expected2 = [[0.804738, -0.310617, 0.505879, 0], [0.505879, 0.804738, -0.310617, 0], [-0.310617, 0.505879, 0.804738, 0], [0, 0, 0, 1]];
actual2 = m_rotation(a = 45, v = v);
assertEqualPoints(expected2, actual2, 0.0005);
}
test_m_rotation();

View File

@@ -100,6 +100,7 @@ include <voxel/test_vx_contour.scad>;
include <matrix/test_m_scaling.scad>;
include <matrix/test_m_translation.scad>;
include <matrix/test_m_determinant.scad>;
include <matrix/test_m_rotation.scad>;
// Voronoi
include <voronoi/test_vrn2_cells_space.scad>;