Physics::Lorentz::Vector - Representation of 4-vectors
use Physics::Lorentz; my $rotation = Physics::Lorentz::Transformation->rotation_euler( $alpha, $beta, $gamma ); my $vector = Physics::Lorentz::Vector->new([$t, $x, $y, $z]); my $rotated = $rotation->apply($vector); # or: $rotated = $rotation * $vector; ...
This class is a representation of 4-vectors (such as 4-space [time, x, y, z] or 4-momentum E, kx, ky, kz).
[time, x, y, z]
E, kx, ky, kz
None.
Addition (+) does the expected thing as does the assignment form (+=) of it.
Stringification is overloaded with the stringify method.
stringify
See also: Physics::Lorentz::Transformation.
Creates a new Physics::Lorentz::Vector object. Defaults to [0,0,0,0] or cloning if no arguments are specified.
[0,0,0,0]
If one argument is present, this argument may either be a PDL which will be used internally as the PDL representation of the vector or an array reference to an array of four elements.
Returns a copy of the object.
Returns a string representation of the object. Currently, this is the string representation of the internal PDL vector/matrix.
Adds two vectors. Syntax:
$v3 = $v1->add($v2);
(This leaves $v1 and $v2 unchanged!)
$v1
$v2
Returns the PDL representation of the object. This is the actual PDL object used inside. Beware of action at a distance.
PDL, Physics::Lorentz, Physics::Lorentz::Transformation
Steffen Müller, <smueller@cpan.org>
Copyright (C) 2006 by Steffen Müller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Müller,'. Assuming UTF-8
To install Physics::Lorentz, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Physics::Lorentz
CPAN shell
perl -MCPAN -e shell install Physics::Lorentz
For more information on module installation, please visit the detailed CPAN module installation guide.