Steffen Müller > Physics-Lorentz > Physics::Lorentz::Vector

Download:
Physics-Lorentz-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

Physics::Lorentz::Vector - Representation of 4-vectors

SYNOPSIS ^

  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;
  
  ...

DESCRIPTION ^

This class is a representation of 4-vectors (such as 4-space [time, x, y, z] or 4-momentum E, kx, ky, kz).

EXPORT

None.

OVERLOADED INTERFACE

Addition (+) does the expected thing as does the assignment form (+=) of it.

Stringification is overloaded with the stringify method.

See also: Physics::Lorentz::Transformation.

METHODS ^

new

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.

clone

Returns a copy of the object.

stringify

Returns a string representation of the object. Currently, this is the string representation of the internal PDL vector/matrix.

add

Adds two vectors. Syntax:

  $v3 = $v1->add($v2);

(This leaves $v1 and $v2 unchanged!)

get_pdl

Returns the PDL representation of the object. This is the actual PDL object used inside. Beware of action at a distance.

SEE ALSO ^

PDL, Physics::Lorentz, Physics::Lorentz::Transformation

AUTHOR ^

Steffen Müller, <smueller@cpan.org>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: