< Back to IRCAM Forum

Spat quaternion inverse?

How can one take the inverse of a quaternion using spat?

Also a question regarding quat.fromvectors. Is one is starting with a quaternion such as the one in the below picture, how can one pass this information into quat.fromvectors? Is there an example that is provided online? The inputs in the documentation seem to be a bit complicated.

Screen Shot 2022-06-08 at 4.31.52 PM

Hi,

  1. spat5.quat.inverse

  2. you need to provide two vectors (in xyz or aed or other format) to compute the rotation quaternion.
    Here is another (simpler ?) example below :


----------begin_max5_patcher----------
1038.3oc2YtsbihCDF9Z6mBUbsGGIw48ts1ceJlZpovfbFxBRdkDwNYp4ceE
sfYHwNFaLPxtNUrKDG9U+QK0cK88kKb1HNvTNneC8YzhEee4hEPS0Mrn43EN
kIGRKRTvk4TxTpj6YNqrmSyNng1uaatTou6vSOiHl+vqP2oXoBdFzDtto16o
HmaNSEGtQZSi7pxbdASqdUihJcaqjlVyy.EEad3StsOS6koeZGyZLNNnuzbp
cI5zukyu+qRVp1d1.7ZSGLF9lfip+w0cMF8k563GKWV+0pKDHohxRlwVdMP9
mpDMSxyEbTB+9BFRx1IYJykZ5KH82LMHzI55yugo2yXbjdu.49mnGM8SgTc4
3pELap1rofoxyXuMDwGCQBsUpsBtVk+Lb6DxZbGa5gJkNeadJzi6J5IvqWjk
rAgvOg.f8w0.tiP7jRPHmeWlmT37Ba.DX.uL1VHLlqy4fztDoQXyqlux3IMR
gOIpnGiJOROn5X+vUHmMFG.mN1trLAHUvY7Po.BoAdsryb.47DbRbdOKK600
xG2CuNkoGR6X5gwvAtyfyyaAi8NW9fN7kRlPx.HimO.iHXbk0CwM5cjLOOIj
gd8jwO5CFYdZRHS3.HC8CFYNLIjI55IiWv6DYl5fTgwyTPJ+.20tlOgdX6Gu
3oOj0TSuH7bQOb3bDhex40bkRjm+rjRDms2XVGMsUE+AQNG4cE4C4eBXQGBr
dw+mqtlVDQrIMYRWHv7Ij1L7D6OqIQ9GB9iLoVgLYSJaqERKP+UUASZKJRca
oWRGvz9j.ZWFg8e2yurKOVgXGpKSTwxPF2sL18R1sRoAj0.kF.XItAR32cH8
yhkS1XrVn9YWYFJ4P9oKT1cBxxfhG4BkIgvbYtTvkztpD0tmejnLkOyTlDO1
TlP+vSYX0ylYNGMxb1F7Y9w7jmgyLkfSyrAMS59e1DBmqpOHjv+OfKxbUugc
D4Tiqym9r6UjIi2IXE4lRet+sDf5CCAIwyLdTldj+55UccsVvpyG7J.0obpF
Dmt.9XyZtIsv4qThLQkYb0mRKxS+65RHD6p2tDSbSkIRZkBsOmmI1eiESLfU
jkDAA6H9QVfDLa4I2uizVon7Uakzvbl7CctQ2FhO3vPncFV0wlgG.jvyq1JR
3AV29KAgRTISa6BMaCH5WHOiYxYg+yLV97urBzasEeWpPjKPHBYLD5hTBOVJ
Q6QonwRHROBEOBB09l97r6EWiPlYlx8MGJNpJWuFPmRZ7MIM7Tc6QZuwv0DT
pOGlv3wRo97XhvikR89h6X5Ym4JY2tGYRUyUChXlr9AA7ZMZEbXN2dHTImij
8XtpaEUNIRyTmZy7lURarhCA10ZzoTXbP3U4MtmFyyHIDHnNthYBeqk.wKV9
ik+aJfude
-----------end_max5_patcher-----------

Thank you Thibaut! One more question - how does one multiply two quaternions using spat?

Hi,
There is currently no object to perform multiplication of 2 quaternions. You would have to to it yourself with a little piece of patch.
I will try to add an object to facilitate that.
Best,
T.