Natural logarithm of quaternion



ql=quatlog(q) calculates the natural logarithm, ql, for a normalized quaternion, q.

Aerospace Toolbox uses quaternions that are defined using the scalar-first convention.

This function uses the relationships.

For q=[cos(θ),sin(θ)v], with log(q)=[0,θv].


collapse all

Calculate the natural logarithm of quaternion matrix q=[1.0 0 1.0 0].

qlog = quatlog(quatnormalize([1.0 0 1.0 0]))
qlog =

         0         0    0.7854         0

Input Arguments

collapse all

Quaternions for which to calculate the natural logarithm, specified as an M-by-4 matrix containing M quaternions. This quaternion must be a normalized quaternion.

Data Types: double

Output Arguments

collapse all

Natural logarithm of quaternion.


[1] Dam, Erik B., Martin Koch, Martin Lillholm. "Quaternions, Interpolation, and Animation." University of Copenhagen, København, Denmark, 1998.

Introduced in R2016a