Name : perl-Math-Vector-Real
| |
Version : 0.180.0
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp155.1.1
| Date : 2024-07-24 22:40:43
|
Group : Unspecified
| Source RPM : perl-Math-Vector-Real-0.180.0-lp155.1.1.src.rpm
|
Size : 0.04 MB
| |
Packager : https://www_suse_com/
| |
Summary : Real vector arithmetic in Perl
|
Description :
A simple pure perl module to manipulate vectors of any dimension.
The function \'V\', always exported by the module, allows one to create new vectors:
my $v = V(0, 1, 3, -1);
Vectors are represented as blessed array references. It is allowed to manipulate the arrays directly as far as only real numbers are inserted (well, actually, integers are also allowed because from a mathematical point of view, integers are a subset of the real numbers).
Example:
my $v = V(0.0, 1.0);
push AATT$v, 0.0;
$v->[0] = 23;
Vectors can be used in mathematical expressions:
my $u = V(3, 3, 0); $p = $u * $v; # dot product $f = 1.4 * $u + $v; # scalar product and vector addition $c = $u x $v; # cross product, only defined for 3D vectors
The currently supported operations are:
+ * / - (both unary and binary) x (cross product for 3D vectors) += -= *= /= x= == != \"\" (stringfication) abs (returns the norm) atan2 (returns the angle between two vectors)
That, AFAIK, are all the operations that can be applied to vectors.
When an array reference is used in an operation involving a vector, it is automatically upgraded to a vector. For instance:
my $v = V(1, 2); $v += [0, 2];
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl/15.5/noarch |