quat_mul(3alleg4)

πŸ’– quat_mul β€” the Allegro manual's quaternion glow-up πŸ’–

okay bestie, welcome to the Allegro manual page for quat_mul, and trust me, this one is a whole vibe. it's short, it's sweet, it's giving math but make it fashion. let's get into it πŸ¦‹


✨ NAME ✨

quat_mul β€” Multiplies two quaternions. Allegro game programming library.


πŸŽ€ SYNOPSIS πŸŽ€

no cap, here's the tea:

#include <allegro.h>

void quat_mul(const QUAT *p, const QUAT *q, QUAT *out);

πŸ’… DESCRIPTION πŸ’…

so what does it do?? it multiplies two quaternions, and it stores the result in out. simple. iconic. main character energy fr fr.

here's the part that actually matters though β€” the resulting quaternion has the same effect as the combination of p and q. like, when you apply it to a point:

(point * out) = ((point * p) * q)

yes bestie, that's the whole point (pun intended 😭). you can concatenate any number of rotations this way, just stacking them up like your skincare routine. obsessed.

⚠️ okay but hear me β€” quaternion multiplication is not commutative. that means quat_mul(p, q) != quat_mul(q, p). order matters, babes. it's giving "outfit first, then shoes" not "shoes first, then outfit." do not flip them and act surprised πŸ’€

🫢 and that's the page!! no notes, she's perfect, she's brief, she ate.

this little gem lives in the Allegro manual, and it's from version 4.4.3. go forth and multiply (quaternions, specifically) πŸŒΈβœ¨πŸ’œ