â„–25070[Quote]
i use them a lot, and i still don't understand how they work. they were invented by an irish "mathematician" while he was drunk
â„–25071[Quote]
>>25070Now it makes sense. How do you use them without understanding them?
â„–25072[Quote]
>>25071i have math libraries that use them. they convert euler to quaternion, and sometimes i convert quaternions to a 4x4 matrix. i don't know how the fuck it works. i wrote a math library to do it myself once, and maybe i understood how it worked for 10 seconds? nobaldi cares
â„–25073[Quote]
>>25072I mean is there a way to even visualise them? For better understanding? Or are those just 4 snca numbers
â„–25074[Quote]
>>25073it's all bullshit as far as i can tell. you'll have to look into it on your own time because i can't explain it
â„–25181[Quote]
A quaternion is a number system where an element is of the form
q = w + xi + yj + zk
where
i^2 = j^2 = k^2 = ijk = -1
and multiplication is anti-communitative
ij = k, ji = -k
jk = i, kj = -i
ki = j, ik = -j
and a unit quaternion has length 1:
\lVert q \rVert = \sqrt{w^2 + x^2 + y^2 + z^2} = 1
and any 3D rotation can be represented as
q = \cos(\frac{\theta}{2}) + (ai + bj + zk)\sin(\frac{\theta}{2})
where \theta is the rotation angle and (x, y, z) is a unit vector along the rotation axis
To perform a rotation of a vector v, treat it as a quaternion with real part equal to 0, and apply
v' = q v q^{-1}
which avoids gimbal lock (occurs in Euler angles)
Quaternions are used to describe 2D and 3D rotations, and avoid gimbal lock (occurs in Euler angles when pitch/yaw/roll axes line up due to specific angle combination, resulting in loss of degree of freedom)
Quaternions also provide spherical linear interpolation, allowing for constant angular rotation speed and always follow the shortest rotation path
Quaternions are also far easier to combine rotations to as well, and integrate the best with physics engines due to having simple algebra
They're also used in quantum physics o algo, to represent electron spins
â„–25197[Quote]
A