
<?php
bool public Imagick::affineTransformImage(ImagickDraw $matrix);
?>
EXERCISE
<?php
// Run several times
$img1 = new Imagick(PATH2IMGW . '/gif/E 01 01.gif');
$tmp1 = 'img/results/E 01 01af561.gif';
$drw1 = new ImagickDraw();
$ang1 = deg2rad(mt_rand(0, 360));
// BEWARE of the following array terms
$affrot1 = [ "sx" => cos($ang1), "sy" => cos($ang1),
"rx" => sin($ang1), "ry" => sin($ang1),
"tx" => 0, "ty" => 0 ];
$drw1->affine($affrot1);
$img1->affineTransformImage($drw1);
$Data = $img1->getImageBlob();
$img = imagecreatefromstring($Data);
imagegif($img, $tmp1);
echo basename($tmp1); ?>
<br><br>
<img src="<?php echo $tmp1; ?>"
alt="<?php echo $tmp1; ?>"
title="<?php echo $tmp1; ?>">
Array
(
[sx] => -0.98162718344766
[sy] => -0.98162718344766
[rx] => -0.19080899537654
[ry] => 0.19080899537654
[tx] => 0
[ty] => 0
)