Re: [PATCH v7 5/6] iio: ABI: Add partial quaternion modifier

From: Andy Shevchenko

Date: Wed Mar 04 2026 - 06:55:54 EST


On Wed, Mar 04, 2026 at 09:07:05AM +0100, Francesco Lavra wrote:
> This modifier applies to the IIO_ROT channel type, and indicates a data
> representation that specifies the {x, y, z} components of the normalized
> quaternion vector.

...

> +What: /sys/bus/iio/devices/iio:deviceX/in_rot_partial_quaternion_raw

> + Raw value of {x, y, z} components of the quaternion vector. These
> + components represent the axis about which a rotation occurs, and are
> + subject to the following costraints:
> + - the quaternion vector is normalized, i.e. x^2 + y^2 + z^2 + w^2 = 1
> + - the rotation angle is within the [-180, 180] range, i.e. the w
> + component (which represents the amount of rotation) is non-negative
> + These constraints allow the w value to be calculated from the other
> + components: w = sqrt(1 - (x^2 + y^2 + z^2)).

Just to double check if we really do not have a special mathematical term for
that already. If we do, I prefer to have that over odd "partial quaternion".

--
With Best Regards,
Andy Shevchenko