From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: "Francesco Lavra" <flavra@baylibre.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v7 5/6] iio: ABI: Add partial quaternion modifier
Date: Fri, 6 Mar 2026 14:10:47 +0200 [thread overview]
Message-ID: <aarER76yQLyasKJa@ashevche-desk.local> (raw)
In-Reply-To: <e145d179-d8c4-44d3-ac7d-1721b676cf01@baylibre.com>
On Thu, Mar 05, 2026 at 08:40:26AM -0600, David Lechner wrote:
> On 3/5/26 2:50 AM, Francesco Lavra wrote:
> > On Wed, 2026-03-04 at 16:42 -0600, David Lechner wrote:
> >> On 3/4/26 8:21 AM, Francesco Lavra wrote:
> >>> On Wed, 2026-03-04 at 13:51 +0200, Andy Shevchenko wrote:
> >>>> On Wed, Mar 04, 2026 at 09:07:05AM +0100, Francesco Lavra wrote:
...
> >>>>> +What: /sys/bus/iio/devices/iio:deviceX/in_rot_partial_qua
> >>>>> tern
> >>>>> ion_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".
> >>>
> >>> A quaternion is often represented as w + xi + yj + zk, i.e. it's
> >>> composed
> >>> of a real coefficient (w) and 3 imaginary coefficients (x, y, z). With
> >>> this
> >>> notation, the (x, y, z) components are referred to as the imaginary
> >>> part of
> >>> the quaternion.
> >>> Alternatively, a quaternion is represented as the combination of a
> >>> scalar
> >>> value w and a 3D vector value (x, y, z). With this notation, the (x, y,
> >>> z)
> >>> components are referred to as the vector part of the quaternion; this
> >>> can
> >>> be confusing, since the quaternion as a whole is often considered as a
> >>> 4D
> >>> vector.
> >>
> >> I'm surprised there isn't a common name for this. When I went looking,
> >> the
> >> thing that came up most often is that Doom 3 used this in their MD5 file
> >> format. So maybe IIO_MOD_DOOM3_QUATERNION? (joking)
> >>
> >> I do think we could come up with something better than "partial" though.
> >>
> >> My first thought is IIO_MOD_3D_QUATERNION since it is a 3-dimentional
> >> number,
> >> but I could see that being confusing to some since quaternions are
> >> generally
> >> used for rotations in 3-D space.
> >>
> >> Maybe something like IIO_MOD_3VALUE_QUATERNION or
> >> IIO_MOD_COMPRESSED_QUATERNION
> >> or just IIO_MOD_3QUATERNION?
> >
> > Or, since this represents the axis of rotation, perhaps something like
> > IIO_MOD_QUATERNION_AXIS?
>
> Sounds OK to me.
Agree, this is at least better than opaque "partial".
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-03-06 12:10 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 8:05 [PATCH v7 0/6] imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-04 8:06 ` [PATCH v7 1/6] iio: imu: st_lsm6dsx: Fix check for invalid samples from FIFO Francesco Lavra
2026-03-07 12:46 ` Jonathan Cameron
2026-03-07 15:23 ` Lorenzo Bianconi
2026-03-07 17:04 ` Jonathan Cameron
2026-03-07 17:20 ` Lorenzo Bianconi
2026-03-04 8:06 ` [PATCH v7 2/6] iio: Replace 'sign' field with union in struct iio_scan_type Francesco Lavra
2026-03-04 22:55 ` David Lechner
2026-03-07 12:47 ` Jonathan Cameron
2026-03-07 13:10 ` Jonathan Cameron
2026-03-04 8:06 ` [PATCH v7 3/6] iio: tools: Add support for floating-point numbers in buffer scan elements Francesco Lavra
2026-03-04 22:53 ` David Lechner
2026-03-04 8:06 ` [PATCH v7 4/6] iio: ABI: " Francesco Lavra
2026-03-04 22:45 ` David Lechner
2026-03-05 9:09 ` Francesco Lavra
2026-03-05 9:23 ` Andy Shevchenko
2026-03-05 14:37 ` David Lechner
2026-03-06 12:09 ` Andy Shevchenko
2026-03-07 12:51 ` Jonathan Cameron
2026-03-17 10:40 ` Francesco Lavra
2026-03-04 8:07 ` [PATCH v7 5/6] iio: ABI: Add partial quaternion modifier Francesco Lavra
2026-03-04 11:51 ` Andy Shevchenko
2026-03-04 14:21 ` Francesco Lavra
2026-03-04 22:42 ` David Lechner
2026-03-05 8:50 ` Francesco Lavra
2026-03-05 14:40 ` David Lechner
2026-03-06 12:10 ` Andy Shevchenko [this message]
2026-03-04 19:25 ` kernel test robot
2026-03-04 22:35 ` David Lechner
2026-03-05 7:04 ` Andy Shevchenko
2026-03-07 13:00 ` Jonathan Cameron
2026-03-07 13:03 ` Jonathan Cameron
2026-03-08 20:27 ` Andy Shevchenko
2026-03-14 11:14 ` Jonathan Cameron
2026-03-07 13:05 ` Jonathan Cameron
2026-03-04 8:07 ` [PATCH v7 6/6] iio: imu: st_lsm6dsx: Add support for rotation sensor Francesco Lavra
2026-03-04 13:39 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aarER76yQLyasKJa@ashevche-desk.local \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=flavra@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®