Navigation

Operators and Keywords

Function List:

C++ API

Function File: q = diag (v)

Function File: q = diag (v, k)

Return a diagonal quaternion matrix with quaternion vector V on diagonal K. The second argument is optional. If it is positive, the vector is placed on the K-th super-diagonal. If it is negative, it is placed on the -K-th sub-diagonal. The default value of K is 0, and the vector is placed on the main diagonal. Given a matrix argument, instead of a vector, diag extracts the K-th diagonal of the matrix.

Package: quaternion