Поправки в документацию: кватернионы и версоры / Little fixes in documentation: quaternions and versors

This commit is contained in:
Andrey Pokidov 2024-11-25 15:55:36 +07:00
parent d906c8a8ae
commit d3a9fecb67
2 changed files with 29 additions and 14 deletions

View file

@ -1,6 +1,6 @@
# Quaternions # Quaternions
If brief, quaternions are hypercompex numbers with one real component and three If brief, quaternions are hypercomplex numbers with one real component and three
complex components. Quaternions can be represented with formulas: complex components. Quaternions can be represented with formulas:
![Definition of quaternions](./media/quaternion_definition.png) ![Definition of quaternions](./media/quaternion_definition.png)
@ -23,8 +23,8 @@ as for a four-dimensional vector;
* modulus of a quaternion is calculated the same way as for four-dimensional * modulus of a quaternion is calculated the same way as for four-dimensional
vector. vector.
But the product of two quaternions is comletely different result than the dot But the product of two quaternions is comletely different than the dot product
product of two four-dimensional vectors. of two four-dimensional vectors.
Another way to represent a quaternion is a pair of a real number and Another way to represent a quaternion is a pair of a real number and
a three-dimensional vector: a three-dimensional vector:
@ -52,13 +52,17 @@ Versors are not possible to add and subtract. Versors cannot be mutiplied
or divided with a real number. But quaternions can be added and subtracted, or divided with a real number. But quaternions can be added and subtracted,
multiplied and divided with a number. multiplied and divided with a number.
But versors can be combined. It is the same operation as multiplication of Versors can be combined. It is the same operation as multiplication of
two quaternions but the function of combination of two versors watches that two quaternions but the function of combination of two versors watches that
the resulting versor has modulus equal to 1. the resulting versor has modulus equal to 1.
All the functions which change the state of a versor keep the modulus of All the functions which change the state of a versor keep the modulus of
a versor close to 1. a versor close to 1.
Yes, the modulus of a versor is very close to 1 because floating point numbers
are not perfect and have little aberrations. Thus the modulus is not always
equal to 1 but very close to 1.
There two structural types for quaternions: There two structural types for quaternions:
typedef struct { typedef struct {

View file

@ -38,19 +38,30 @@
## Реализация кватернионов в библиотеке ## Реализация кватернионов в библиотеке
В библиотеке кватернионы реализованы как в виде обычных кватернионов, так и В библиотеке кватернионы реализованы в двух вариантах:
в виде веросоров. * в виде обычных кватернионов
* в виде веросоров
Главное отличие в том, что реализация версоров ориентирована именно для Главное отличие в реализации кватернионов и версоров том, что реализация
представления поворотов в трёхмерном пространстве. версоров ориентирована именно для представления поворотов в трёхмерном
евклидовом пространстве пространстве, в то время как кватернионы имеют более
общую реализацию.
Версоры нельзя складывать, вычитать, что можно делать с кватернионами. Также Версоры нельзя складывать, вычитать. Также версоры нельзя умножать и делить на
версоры нельзя умножать и делить на вещественные числа. вещественные числа. Но кватернионы можно складывать, вычитать, а также умножать
и делить на вещественное число.
Но версоры можно комбинировать. Операция комбинирования версоров по является Версоры можно комбинировать. Операция комбинирования версоров является обычным
обычным произведением кватернионов. Единственное отличие в том, что операция произведением кватернионов. Единственное отличие в том, что операция
комбинирования версоров обеспечивает, чтобы результат комбинации также был комбинирования версоров обеспечивает, чтобы результат комбинации также имел
версором, то есть, имел модуль, равный единицы. модуль, равный единицы.
Все функции версоров, которые менияют состояние версора, обеспечивают, чтобы
модуль версора оставался близким к единице.
Да, модуль версора очень близок к единице, потому что числа с плавающей запятой
не совершенны и имеют небольшие погрешности. Поэтому модуль не всегда равен
единице, но очень близок к единице.
Для описаия кватернионов есть две структуры: Для описаия кватернионов есть две структуры: