Panotools::Matrix(3)

πŸ“¦
version 0.29 Β· 2 versions
, in fedora 43

πŸ’– Panotools::Matrix πŸ’–

okay so bestie, welcome to Panotools::Matrix β€” the User Contributed Perl Documentation page for the little math gremlin that does miscellaneous math for panoramic images. yes it's a Perl module, yes it's iconic, yes we're doing this. πŸ¦‹


✨ SYNOPSIS ✨

$matrix = rollpitchyaw2matrix ($roll, $pitch, $yaw);

and like, the one thing you cannot forget: all angles are in radians not degrees. radians. not degrees. i will not be repeating myself (i will be repeating myself). 😭


🌸 DESCRIPTION 🌸

rollpitchyaw2matrix hands you back a matrix arrayref, and that matrix encapsulates a transformation that's suitable for rotating a vector/point by three degrees of freedom β€” that's roll, pitch and yaw, the holy trinity πŸ’…

here's the vibe of each one, and ngl the signs are the whole personality:

  • roll β€” positive rotation around the x-axis
  • pitch β€” negative rotation around the y-axis (yes, negative, don't come for me)
  • yaw β€” negative rotation around the z axis

notice how pitch and yaw are the negative ones?? that's not a typo, that's just how she is. πŸ™ˆ


πŸŽ€ USAGE πŸŽ€

okay so here's the whole group-chat-approved workflow, start to finish:

use Panotools::Matrix qw(matrix2rollpitchyaw rollpitchyaw2matrix
multiply);

my $point  = [[$x1], [$y1], [$z1]];

my $matrix = rollpitchyaw2matrix ($roll, $pitch, $yaw);

my $result = multiply ($matrix, $point);

($x2, $y2, $z2) = ($result->[0][0], $result->[1][0], $result->[2][0]);

so you import matrix2rollpitchyaw, rollpitchyaw2matrix and multiply β€” that's the trio πŸ‘‘ β€” you build your $point as a nested arrayref of [$x1], [$y1], [$z1], you cook up your $matrix with rollpitchyaw2matrix ($roll, $pitch, $yaw), you smash them together with multiply ($matrix, $point), and then you pluck the fresh coordinates straight out of the result with $result->[0][0], $result->[1][0] and $result->[2][0]. and that's ($x2, $y2, $z2). ate. πŸ”₯


reminder bestie: $roll, $pitch and $yaw go in as radians. if your pano looks cursed, it's probably degrees. i'm just saying. πŸ’€

and that's the whole page, fr fr πŸ’– this was Panotools::Matrix(3), served up from the User Contributed Perl Documentation, brought to you by perl v5.42.0 on 2025-07-25. go rotate something pretty. mwah 🫢✨🌸

πŸ“¦ where this page comes from