SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG

 
 

perl-Math-Quaternion rpm build for : openSUSE Tumbleweed. For other distributions click perl-Math-Quaternion.

Name : perl-Math-Quaternion
Version : 0.07 Vendor : obs://build_opensuse_org/devel:languages:perl
Release : 6.69 Date : 2024-08-05 18:24:39
Group : Development/Libraries/Perl Source RPM : perl-Math-Quaternion-0.07-6.69.src.rpm
Size : 0.05 MB
Packager : (none)
Summary : Perl class to represent quaternions
Description :
This package lets you create and manipulate quaternions. A quaternion is a
mathematical object developed as a kind of generalization of complex
numbers, usually represented by an array of four real numbers, and is often
used to represent rotations in three-dimensional space.

See, for example, the http://mathworld.wolfram.com/Quaternion.html manpage
for more details on the mathematics of quaternions.

Quaternions can be added, subtracted, and scaled just like complex numbers
or vectors -- they can also be multiplied, but quaternion multiplication
DOES NOT COMMUTE. That is to say, if you have quaternions $q1 and $q2, then
in general $q1*$q2 != $q2*$q1. This is related to their use in representing
rotations, which also do not commute.

If you just want to represent rotations and don\'t care about the internal
mathematical details, this should be all you need to know:

All quaternions have a quantity called the \"norm\", similar to the length of
a vector. A quaternion with norm equal to 1 is called a \"unit quaternion\".
All quaternions which represent rotations are unit quaternions.

If you call new() without any arguments, it will give you a unit quaternion
which represents no rotation:

$q = Math::Quaternion->new;

You can make a quaternion which represents a rotation of a given angle (in
radians) about a given axis:

$qrot = Math::Quaternion->new({ angle => 0.1, axis => [ 2,3,4]});

Say you have two rotations, $q1 and $q2, and you want to make a quaternion
representing a rotation of $q1 followed by $q2. Then, you do:

$q3 = $q2 * $q1; # Rotate by $q1, followed by $q2.

Remember that this is NOT the same as $q1 * $q2, which will reverse the
order of the rotations.

If you perform many iterated quaternion operations, the result may not
quite be a unit quaternion due to numerical inaccuracies. You can make sure
any quaternion has unit length, by doing:

$unitquat = $anyquat->normalize;

If you have a rotation quaternion, and you want to find the 3x3 matrix
which represents the corresponding rotation, then:

AATTmatrix = $q->matrix3x3;

Similarly, you can generate a 4x4 matrix of the sort you\'d pass to OpenGL:

AATTglmatrix = $q->matrix4x4;

If you have a vector representing a direction, and you want to rotate the
vector by a quaternion $q:

my AATTvector = (0,0,1); # Vector pointing in the Z direction.

my AATTnewvec = $q->rotate_vector(AATTvector); # New direction.

Say you\'re using quaternions to represent the orientation of a camera, and
you have two quaternions: one to represent a starting orientation, and
another to represent a finishing position. If you want to find all the
quaternions representing the orientations in between, allowing your camera
to move smoothly from start to finish, use the slerp() routine:

use Math::Quaternion qw(slerp);

my ($qstart, $qend) = ... ;



for my $t (1..9) {
my $tween = slerp($qstart,$qend,0.1*$t);
...
}

RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-M/openSUSE_Tumbleweed/noarch

Content of RPM  Provides Requires

Download
ftp.icm.edu.pl  perl-Math-Quaternion-0.07-6.69.noarch.rpm
     

Provides :
perl(Math::Quaternion)
perl-Math-Quaternion

Requires :
perl(:MODULE_COMPAT_5.40.0)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1


Content of RPM :
/usr/lib/perl5/vendor_perl/5.40.0/Math
/usr/lib/perl5/vendor_perl/5.40.0/Math/Quaternion.pm
/usr/share/doc/packages/perl-Math-Quaternion
/usr/share/doc/packages/perl-Math-Quaternion/Changes
/usr/share/doc/packages/perl-Math-Quaternion/README
/usr/share/man/man3/Math::Quaternion.3pm.gz

 
ICM