diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-06-14 08:37:55 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-06-14 08:37:55 -0600 |
commit | 9ed4a01ac4305baff9e5ee1484691e78def105a1 (patch) | |
tree | a8b5c556baf7053546e188e42278c6b88c7b0543 /libdimension/dimension | |
parent | 9b758508df283a533a4cfc605545a35f77bc9d5f (diff) | |
download | dimension-9ed4a01ac4305baff9e5ee1484691e78def105a1.tar.xz |
Fix rotational alignment.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r-- | libdimension/dimension/geometry.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libdimension/dimension/geometry.h b/libdimension/dimension/geometry.h index ba8f531..7e466dd 100644 --- a/libdimension/dimension/geometry.h +++ b/libdimension/dimension/geometry.h @@ -178,6 +178,16 @@ dmnsn_matrix dmnsn_translation_matrix(dmnsn_vector d); * @return The transformation matrix. */ dmnsn_matrix dmnsn_rotation_matrix(dmnsn_vector theta); +/** + * An alignment matrix. + * @param[in] from The initial vector. + * @param[in] to The desired direction. + * @param[in] axis1 The first axis about which to rotate. + * @param[in] axis2 The second axis about which to rotate. + * @return A transformation matrix that will rotate \p from to \p to. + */ +dmnsn_matrix dmnsn_alignment_matrix(dmnsn_vector from, dmnsn_vector to, + dmnsn_vector axis1, dmnsn_vector axis2); /** * Construct a new line. @@ -359,10 +369,6 @@ dmnsn_vector_max(dmnsn_vector a, dmnsn_vector b) ); } -/** Return the angle between two vectors with respect to an axis. */ -double dmnsn_vector_axis_angle(dmnsn_vector v1, dmnsn_vector v2, - dmnsn_vector axis); - /** Invert a matrix. */ dmnsn_matrix dmnsn_matrix_inverse(dmnsn_matrix A); |