Fixes in quaternion inverse computation
This commit is contained in:
parent
2eab5b7b9a
commit
b45f605209
1 changed files with 2 additions and 2 deletions
|
|
@ -149,13 +149,13 @@ namespace psemek::geom
|
||||||
template <typename T>
|
template <typename T>
|
||||||
quaternion<T> conjugate(quaternion<T> const & q)
|
quaternion<T> conjugate(quaternion<T> const & q)
|
||||||
{
|
{
|
||||||
return {q[0], -q[1], -q[2], -q[3]};
|
return {{q[0], -q[1], -q[2], -q[3]}};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
quaternion<T> inverse(quaternion<T> const & q)
|
quaternion<T> inverse(quaternion<T> const & q)
|
||||||
{
|
{
|
||||||
return conjugate(q) / norm(q);
|
return {conjugate(q).coords / norm(q)};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue