diff options
Diffstat (limited to 'libdimension')
-rw-r--r-- | libdimension/dimension/geometry.h | 2 | ||||
-rw-r--r-- | libdimension/geometry.c | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index ca10163..fccd1bc 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -50,6 +50,8 @@ dmnsn_matrix dmnsn_matrix_construct(double a0, double a1, double a2, double a3, double b0, double b1, double b2, double b3, double c0, double c1, double c2, double c3, double d0, double d1, double d2, double d3); + +dmnsn_matrix dmnsn_scale_matrix(dmnsn_vector s); dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d); /* theta/|theta| = axis, |theta| = angle */ dmnsn_matrix dmnsn_rotation_matrix(dmnsn_vector theta); diff --git a/libdimension/geometry.c b/libdimension/geometry.c index 846095c..a89fb9e 100644 --- a/libdimension/geometry.c +++ b/libdimension/geometry.c @@ -43,6 +43,15 @@ dmnsn_matrix_construct(double a0, double a1, double a2, double a3, return m; } +dmnsn_matrix +dmnsn_scale_matrix(dmnsn_vector s) +{ + return dmnsn_matrix_construct(s.x, 0.0, 0.0, 0.0, + 0.0, s.y, 0.0, 0.0, + 0.0, 0.0, s.z, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + /* Translation matrix */ dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d) |