Math-Zap

 view release on metacpan or  search on metacpan

lib/Math/Zap/Color.pm  view on Meta::CPAN

 }


=head3 is

Same as L</check> but return the result to the caller.   

=cut


sub is(@)
 {for my $t(@_)
   {return 0 unless ref($t) eq __PACKAGE__;
   }
  'color';
 }


=head3 normal

Normal value of the color

lib/Math/Zap/Cube.pm  view on Meta::CPAN

 }


=head3 is

Same as L</check> but return the result to the caller.   

=cut


sub is(@)
 {for my $r(@_)
   {return 0 unless ref($r) eq __PACKAGE__;
   }
  'cube';
 }


=head3 a, x, y, z

Components of cube

lib/Math/Zap/Draw.pm  view on Meta::CPAN

 }


=head3 to

Viewing this point

=cut


sub to($$)
 {my ($d) =         check(@_[0..0]); # Drawing 
  my ($v) = vectorCheck(@_[1..1]); # Vector

  $d->{to} = $v;
  $d;
 }


=head3 Horizon

lib/Math/Zap/Draw.pm  view on Meta::CPAN

 }


=head3 is

Test its a drawing 

=cut


sub is(@)
 {for my $t(@_)
   {return 0 unless ref($t) eq __PACKAGE__;
   }
  'draw';
 }


=head3 showFissionFragments

Show fission fragments: the objects to be drawn are triangulated

lib/Math/Zap/Line2.pm  view on Meta::CPAN

 }


=head3 is

Test its a line

=cut


sub is(@)
 {for my $l(@_)
   {return 0 unless ref($l) eq __PACKAGE__;
   }
  'line2';
 }


=head3 a,b,ab,ba

Components of line

=cut


sub a($)  {check(@_) if (debug); $_[0]->{a}}
sub b($)  {check(@_) if (debug); $_[0]->{b}}
sub ab($) {check(@_) if (debug); vector2($_[0]->{b}{x}-$_[0]->{a}{x}, $_[0]->{b}{y}-$_[0]->{a}{y})}
sub ba($) {check(@_) if (debug); $_[0]->a-$_[0]->b}


=head3 clone 

Create a line from another line

=cut


sub clone($)

lib/Math/Zap/Matrix.pm  view on Meta::CPAN

 }


=head3 is

Test its a matrix

=cut


sub is(@)
 {for my $m(@_)
   {return 0 unless ref($m) eq __PACKAGE__;
   }
  'matrix';
 }


=head3 singular

Singular matrix?

lib/Math/Zap/Matrix.pm  view on Meta::CPAN

 }


=head3 d2

Determinant of 2*2 matrix

=cut


sub d2($$$$)
 {my ($a, $b, $c, $d) = @_;    
  $a*$d-$b*$c;
 }


=head3 inverse

Inverse of matrix

=cut

lib/Math/Zap/Matrix2.pm  view on Meta::CPAN

 }


=head3 is

Test its a matrix

=cut


sub is(@)
 {for my $m(@_)
   {return 0 unless ref($m) eq __PACKAGE__;
   }
  'matrix2';
 }


=head3 accuracy

Get/Set accuracy 

lib/Math/Zap/Rectangle.pm  view on Meta::CPAN

 }


=head3 is

Test its a rectangle

=cut


sub is(@)
 {for my $r(@_)
   {return 0 unless ref($r) eq __PACKAGE__;
   }
  'rectangle';
 }


=head3 a,b,c

Components of rectangle

lib/Math/Zap/Triangle.pm  view on Meta::CPAN

 }


=head3 is

Test its a triangle

=cut


sub is(@)
 {for my $t(@_)
   {return 0 unless ref($t) eq __PACKAGE__;
   }
  'triangle';
 }


=head3 components

Components of a triangle

=cut


sub a($)   {check(@_) if debug; $_[0]->{a}}
sub b($)   {check(@_) if debug; $_[0]->{b}}
sub c($)   {check(@_) if debug; $_[0]->{c}}

sub ab($)  {check(@_) if debug; ($_[0]->{b}-$_[0]->{a})}
sub ac($)  {check(@_) if debug; ($_[0]->{c}-$_[0]->{a})}
sub ba($)  {check(@_) if debug; ($_[0]->{a}-$_[0]->{b})}
sub bc($)  {check(@_) if debug; ($_[0]->{c}-$_[0]->{b})}
sub ca($)  {check(@_) if debug; ($_[0]->{a}-$_[0]->{c})}
sub cb($)  {check(@_) if debug; ($_[0]->{b}-$_[0]->{c})}

sub abc($) {check(@_) if debug; ($_[0]->{a}, $_[0]->{b}, $_[0]->{c})}
sub area($){check(@_) if debug; ($_[0]->ab x $_[0]->ac)->length}


=head3 clone

Create a triangle from another triangle 

=cut

lib/Math/Zap/Triangle2.pm  view on Meta::CPAN

 }


=head3 is

Test its a triangle

=cut


sub is(@)
 {for my $t(@_)
   {return 0 unless ref($t) eq __PACKAGE__;
   }
  'triangle2';
 }


=head3 components

Components of a triangle

=cut


sub a($)   {check(@_) if debug; $_[0]->{a}}
sub b($)   {check(@_) if debug; $_[0]->{b}}
sub c($)   {check(@_) if debug; $_[0]->{c}}

sub ab($)  {check(@_) if debug; ($_[0]->{b}-$_[0]->{a})}
sub ac($)  {check(@_) if debug; ($_[0]->{c}-$_[0]->{a})}
sub ba($)  {check(@_) if debug; ($_[0]->{a}-$_[0]->{b})}
sub bc($)  {check(@_) if debug; ($_[0]->{c}-$_[0]->{b})}
sub ca($)  {check(@_) if debug; ($_[0]->{a}-$_[0]->{c})}
sub cb($)  {check(@_) if debug; ($_[0]->{b}-$_[0]->{c})}

sub abc($) {check(@_) if debug; ($_[0]->{a}, $_[0]->{b}, $_[0]->{c})}

sub lab($)  {check(@_) if debug; line2($_[0]->{b}, $_[0]->{a})}
sub lac($)  {check(@_) if debug; line2($_[0]->{c}, $_[0]->{a})}
sub lba($)  {check(@_) if debug; line2($_[0]->{a}, $_[0]->{b})}
sub lbc($)  {check(@_) if debug; line2($_[0]->{c}, $_[0]->{b})}
sub lca($)  {check(@_) if debug; line2($_[0]->{a}, $_[0]->{c})}
sub lcb($)  {check(@_) if debug; line2($_[0]->{b}, $_[0]->{c})}

lib/Math/Zap/Vector.pm  view on Meta::CPAN

 }


=head4 is

Test its a vector

=cut


sub is(@)
 {for my $v(@_)
   {return 0 unless ref($v) eq __PACKAGE__;
   }
  'vector';
 }


=head4 accuracy

Get/Set accuracy for comparisons

lib/Math/Zap/Vector2.pm  view on Meta::CPAN

 }


=head3 is

Test its a vector

=cut


sub is(@)
 {for my $v(@_)
   {return 0 unless ref($v) eq __PACKAGE__;
   }
  1;
 }


=head3 accuracy

Get/Set accuracy for comparisons



( run in 2.313 seconds using v1.01-cache-2.11-cpan-524268b4103 )