|
#!/usr/bin/perl
my($a,$b,$c,$d,$e,$f,$g,$h,$i)=(551,0,756,551,-186,-385,551,955,0);
my $det=det33($a,$b,$c,$d,$e,$f,$g,$h,$i);
my $a2=det22($e,$f,$h,$i) / $det;
my $b2=det22($c,$b,$i,$h) / $det;
my $c2=det22($b,$c,$e,$f) / $det;
my $d2=det22($f,$d,$i,$g) / $det;
my $e2=det22($a,$c,$g,$i) / $det;
my $f2=det22($c,$a,$f,$d) / $det;
my $g2=det22($d,$e,$g,$h) / $det;
my $h2=det22($b,$a,$h,$g) / $det;
my $i2=det22($a,$b,$d,$e) / $det;
print "$a2 $b2 $c2\n";
print "$d2 $e2 $f2\n";
print "$g2 $h2 $i2\n";
my $rr=105555*$a2-64218*$b2+131072*$c2;
my $gg=105555*$d2-64218*$e2+131072*$f2;
my $bb=105555*$g2-64218*$h2+131072*$i2;
print "\n$rr $gg $bb\n";
$a2*=551*1024;
$b2*=551*1024;
$c2*=551*1024;
$d2*=551*1024;
$e2*=551*1024;
$f3*=551*1024;
$g2*=551*1024;
$h2*=551*1024;
$i2*=551*1024;
print "$a2 $b2 $c2\n";
print "$d2 $e2 $f2\n";
print "$g2 $h2 $i2\n";
sub det33 { my($a,$b,$c,$d,$e,$f,$g,$h,$i)=@_;
return(($a*$e*$i+$b*$f*$g+$c*$d*$h)-($a*$f*$h+$b*$d*$i+$c*$e*$g));
}
sub det22 { my ($a,$b,$c,$d)=@_; return $a*$d-$b*$c;} |
|