3*3 matrix manipulation
PhilipRBrenan@yahoo.com, 2004, Perl License
Example t/matrix.t
#_ Matrix _____________________________________________________________ # Test 3*3 matrices # philiprbrenan@yahoo.com, 2004, Perl License #______________________________________________________________________ use Math::Zap::Matrix identity=>i; use Math::Zap::Vector; use Test::Simple tests=>8; my ($a, $b, $c, $v); $a = matrix (8, 0, 0, 0, 8, 0, 0, 0, 8 ); $b = matrix (4, 2, 0, 2, 4, 2, 0, 2, 4 ); $c = matrix (4, 2, 1, 2, 4, 2, 1, 2, 4 ); $v = vector(1,2,3); ok($a/$a == i()); ok($b/$b == i()); ok($c/$c == i()); ok(2/$a*$a/2 == i()); ok(($a+$b)/($a+$b) == i()); ok(($a-$c)/($a-$c) == i()); ok(-$a/-$a == i()); ok(1/$a*($a*$v) == $v);
Create a matrix
Create a matrix = synonym for "new"
Create a matrix from three vectors
Create a matrix from three vectors without checking
Check its a matrix
Test its a matrix
Singular matrix?
Get/Set accuracy for comparisons
Round: round to nearest integer if within accuracy of that integer
Create a matrix from another matrix
Print matrix
Add matrices
Negate matrix
Subtract matrices
Vector = Matrix * Vector
Matrix = Matrix * scalar
Matrix = Matrix * Matrix
Matrix=Matrix / non zero scalar
Determinant of matrix.
Determinant of 2*2 matrix
Inverse of matrix
Identity matrix
Equals to within accuracy
Operator overloads
Add operator.
Negate operator.
Multiply operator.
Divide operator.
Equals operator.
Determinant of a matrix
Print a vector.
Export "matrix", "identity", "new3v", "new3vnc"
philiprbrenan@yahoo.com
philiprbrenan@yahoo.com, 2004
Perl License.
To install Math::Zap::Draw, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Zap::Draw
CPAN shell
perl -MCPAN -e shell install Math::Zap::Draw
For more information on module installation, please visit the detailed CPAN module installation guide.