summaryrefslogtreecommitdiffstats
path: root/libdimension/geometry.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-14 18:17:57 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-14 18:17:57 +0000
commit6d3e9c207696a331da03a168a8dfa5a4a9d1e3bf (patch)
tree3d86e0681ff26b678b3e414aae7a3080775ec13d /libdimension/geometry.c
parent3ce0bfcd0e16d909b7495f07c9e8a82e4781ee88 (diff)
downloaddimension-6d3e9c207696a331da03a168a8dfa5a4a9d1e3bf.tar.xz
New dmnsn_identity_matrix() function.
Diffstat (limited to 'libdimension/geometry.c')
-rw-r--r--libdimension/geometry.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libdimension/geometry.c b/libdimension/geometry.c
index a89fb9e..e9c2122 100644
--- a/libdimension/geometry.c
+++ b/libdimension/geometry.c
@@ -43,6 +43,17 @@ dmnsn_matrix_construct(double a0, double a1, double a2, double a3,
return m;
}
+/* Identity matrix */
+dmnsn_matrix
+dmnsn_identity_matrix()
+{
+ return dmnsn_matrix_construct(1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0);
+}
+
+/* Scaling matrix */
dmnsn_matrix
dmnsn_scale_matrix(dmnsn_vector s)
{
@@ -62,7 +73,7 @@ dmnsn_translation_matrix(dmnsn_vector d)
0.0, 0.0, 0.0, 1.0);
}
-/* Rotation matrix; theta/|theta| = axis, |theta| = angle */
+/* Left-handed rotation matrix; theta/|theta| = axis, |theta| = angle */
dmnsn_matrix
dmnsn_rotation_matrix(dmnsn_vector theta)
{