1 #include "libnr/nr-matrix-ops.h"
3 NR::Matrix
4 operator/(NR::Matrix const &m, NR::scale const &s)
5 {
6 using NR::X; using NR::Y;
7 NR::Matrix ret(m);
8 ret[0] /= s[X]; ret[1] /= s[Y];
9 ret[2] /= s[X]; ret[3] /= s[Y];
10 ret[4] /= s[X]; ret[5] /= s[Y];
11 assert_close( ret, m * NR::Matrix(s.inverse()) );
12 return ret;
13 }
15 NR::Matrix
16 operator*(NR::Matrix const &m, NR::scale const &s)
17 {
18 using NR::X; using NR::Y;
19 NR::Matrix ret(m);
20 ret[0] *= s[X]; ret[1] *= s[Y];
21 ret[2] *= s[X]; ret[3] *= s[Y];
22 ret[4] *= s[X]; ret[5] *= s[Y];
23 assert_close( ret, m * NR::Matrix(s) );
24 return ret;
25 }
28 /*
29 Local Variables:
30 mode:c++
31 c-file-style:"stroustrup"
32 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
33 indent-tabs-mode:nil
34 fill-column:99
35 End:
36 */
37 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :