cleanup-2008 2315: Update matrix rotation + FIx make::box1d.

https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr> Update matrix rotation + FIx make::box1d. * mln/make/box1d.hh: Remove ambiguity. * mln/fun/x2x/rotation.hh: Add 2d case. fun/x2x/rotation.hh | 18 ++++++++++++------ make/box1d.hh | 3 +-- 2 files changed, 13 insertions(+), 8 deletions(-) Index: mln/make/box1d.hh --- mln/make/box1d.hh (revision 2314) +++ mln/make/box1d.hh (working copy) @@ -82,9 +82,8 @@ mln::box1d box1d(def::coord min_ind, def::coord max_ind) { mln_precondition(max_ind >= min_ind); - mln::box1d tmp(point1d(min_ind), + return mln::box1d(point1d(min_ind), point1d(max_ind)); - return tmp; } # endif // ! MLN_INCLUDE_ONLY Index: mln/fun/x2x/rotation.hh --- mln/fun/x2x/rotation.hh (revision 2314) +++ mln/fun/x2x/rotation.hh (working copy) @@ -98,14 +98,20 @@ template <typename C > algebra::h_mat<2, C> - get_rot_h_mat(const float alpha_, const algebra::vec<2,C>& axis_) + get_rot_h_mat(const float alpha_, const algebra::vec<2,C>&) { - // Avoid a warning about an undefined variable when NDEBUG - // is not defined. - (void) alpha_; - (void) axis_; + algebra::h_mat<2, C> m_; - assert(!"not implemented yet"); + const float cos_a = cos(alpha_); + const float sin_a = sin(alpha_); + + m_(0,0) = cos_a; m_(0,1) = -sin_a; m_(0,2) = 0; + + m_(1,0) = sin_a; m_(1,1) = cos_a; m_(1,2) = 0; + + m_(2,0) = 0; m_(2,1) = 0; m_(2,2) = 1; + + return m_; } }
participants (1)
-
Ugo Jardonnet