Main Content

conj

Complex conjugate of quaternion

Description

example

quatConjugate= conj(quat)returns the complex conjugate of the quaternion,quat.

If q = a + b i + c j + d k , the complex conjugate ofqis q * = a b i c j d k . Considered as a rotation operator, the conjugate performs the opposite rotation. For example,

q = quaternion(deg2rad([16 45 30]),'rotvec'); a = q*conj(q); rotatepoint(a,[0,1,0])
ans = 0 1 0

Examples

collapse all

Create a quaternion scalar and get the complex conjugate.

q = normalize(quaternion([0.9 0.3 0.3 0.25]))
q =quaternion0.87727 + 0.29242i + 0.29242j + 0.24369k
qConj = conj(q)
qConj =quaternion0.87727 - 0.29242i - 0.29242j - 0.24369k

Verify that a quaternion multiplied by its conjugate returns a quaternion one.

q*qConj
ans =quaternion1 + 0i + 0j + 0k

Input Arguments

collapse all

Quaternion to conjugate, specified as a scalar, vector, matrix, or array of quaternions.

Data Types:quaternion

Output Arguments

collapse all

Quaternion conjugate, returned as a quaternion or array of quaternions the same size asquat.

Data Types:quaternion

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Functions

Objects

Introduced in R2018a