5 BEGIN { $|=1; print "1..6\n"; }
6 END { print "not ok 1\n" unless $loaded; }
7 use Imager::Matrix2d ':handy';
11 my $id = Imager::Matrix2d->identity;
13 almost_equal($id, [ 1, 0, 0,
15 0, 0, 1 ]) or print "not ";
17 my $trans = Imager::Matrix2d->translate('x'=>10, 'y'=>-11);
18 almost_equal($trans, [ 1, 0, 10,
20 0, 0, 1 ]) or print "not ";
22 my $rotate = Imager::Matrix2d->rotate(degrees=>90);
23 almost_equal($rotate, [ 0, -1, 0,
25 0, 0, 1 ]) or print "not ";
28 my $shear = Imager::Matrix2d->shear('x'=>0.2, 'y'=>0.3);
29 almost_equal($shear, [ 1, 0.2, 0,
31 0, 0, 1 ]) or print "not ";
34 my $scale = Imager::Matrix2d->scale('x'=>1.2, 'y'=>0.8);
35 almost_equal($scale, [ 1.2, 0, 0,
37 0, 0, 1 ]) or print "not ";
44 abs($m1->[$i] - $m2->[$i]) < 0.00001 or return undef;