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).
Addition (+) does the expected thing as does the assignment form (+=) of it.
Stringification is overloaded with the
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.
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);
Returns the PDL representation of the object. This is the actual PDL object used inside. Beware of action at a distance.
Steffen Müller, <firstname.lastname@example.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.