Physics-Lorentz
view release on metacpan or search on metacpan
lib/Physics/Lorentz/Transformation.pm view on Meta::CPAN
else {
my $vec;
eval { $vec = Physics::Lorentz::Vector->new($vector); };
if ($@ or not _INSTANCE($vec, 'Physics::Lorentz::Vector')) {
croak("${class}->new() needs a 4x4 matrix as PDL or Perl data structure");
}
$self->{vector} = $vec;
}
return bless($self => $class);
}
=head2 rotation_euler
Alternative constructor to construct a specific type of Lorentz transformation:
A 3D rotation with the Euler angles alpha, beta, gamma.
Three arguments: alpha, beta, gamma.
(First rotate about fixed z-axis by alpha, the about fixed y-axis about
lib/Physics/Lorentz/Vector.pm view on Meta::CPAN
elsif (_ARRAY($in) and @$in == 4) {
$self->{pdl} = pdl([$in])->transpose;
}
elsif (not defined $in) {
$self->{pdl} = zeroes(1,4) if not defined $self->{pdl};
}
else {
croak("${class}->new() needs a 4-vector as PDL or list");
}
return bless($self => $class);
}
=head2 clone
Returns a copy of the object.
=cut
sub clone {
my $self = shift;
( run in 0.430 second using v1.01-cache-2.11-cpan-65fba6d93b7 )