Math::Vectors2 - Vectors in two dimensions
use Math::Vectors2; my ($o, $x, $y) = Math::Vectors2::zeroAndUnits; ok $o->print($x, $y) eq '(0,0), (1,0), (0,1)'; my $p1 = $x->times(3); my $p2 = $y->times(4); my $p = $o->plus($p1, $p2); ok $p->print($p1, $p2) eq '(3,4), (3,0), (0,4)'; ok $o->d($p) == 5;
Or more briefly:
use Math::Vectors2; *v = *Math::Vectors2::new; ok v(3,4)->l == 5;
Vectors in two dimensions
Version '20171009'.
The following sections describe the methods in each functional area of this module. For an alphabetic listing of all methods by name see Index.
This module is written in 100% Pure Perl and, thus, it is easy to read, comprehend, use, modify and install via cpan:
sudo cpan install Math::Vectors2
philiprbrenan@gmail.com
http://www.appaapps.com
Copyright (c) 2016-2018 Philip R Brenan.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Math::Vectors2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Vectors2
CPAN shell
perl -MCPAN -e shell install Math::Vectors2
For more information on module installation, please visit the detailed CPAN module installation guide.