Go to the documentation of this file.
11 #ifndef QUATERNION_HPP
12 #define QUATERNION_HPP
92 const double &
w()
const {
return elems[3]; }
99 for(
size_t i = 0;
i < 4; ++
i)
128 for(
size_t i = 0;
i < 4; ++
i)
154 for(
size_t i = 0;
i < 4; ++
i)
192 double angle()
const;
Quaternion conjugate() const
Return the conjugate of the current quaternion.
Point3d rotate(const Point3d &v) const
Apply the rotation contained in this quaternion on the vector.
CU_HOST_DEVICE T & z()
Short access to the third element.
CU_HOST_DEVICE T normsq(const Matrix< nRows, nCols, T > &mat)
Point3d axis() const
Returns the axis of the rotation corresponding to this quaternion.
const VSMultOp< DistNhbdT, MatrixT, VectorT, ScalarT > operator*(DVector< DistNhbdT, MatrixT, VectorT, ScalarT > &p_vec, ScalarT p_a)
Quaternion(const Quaternion &other)
Copy constructor.
Quaternion()
Default constructor.
CU_HOST_DEVICE T & x()
Short access to the first element.
const double & w() const
Accessing the real part of the quaternion.
double & w()
Accessing the real part of the quaternion.
Distributed matrix library.
Point3d inverseRotate(const Point3d &v) const
Apply the inverse of the rotation contained in this quaternion on the vector.
Quaternion & operator*=(const Quaternion &other)
Quaternion in-place multiplication.
void setMatrix(Matrix3d &m) const
Fill the matrix as argument from the quaternion.
Quaternion(double x, double y, double z, double w)
Creates a quaternion specified by its components.
void setAxisAngle(const Point3d &axis, double angle)
Set the quaternion to the described rotation.
Quaternion & operator/=(double v)
Division of a quaternion by a real number.
Quaternion inverse() const
Return the quaternion corresponding to the inverse transform.
Quaternion & operator=(const Quaternion &other)
Assignment operator for quaternions.
Quaternion operator*(const Quaternion &other) const
Quaternion multiplication.
Quaternion & operator+=(const Quaternion &other)
Quaternion in-place addition.
Quaternion operator/(double v) const
Division of a quaternion by a real number.
double angle() const
Returns the angle of the rotation corresponding to this quaternion.
CU_HOST_DEVICE T & i()
Short access to the first element.
CU_HOST_DEVICE T & y()
Short access to the second element.
Quaternion & operator*=(double s)
In-place multiplication of a quaternion by a scalar.
Quaternion(const Point4d &other)
Creates a quaternion from a Point4d.
Quaternion operator+(const Quaternion &other) const
Quaternion addition.