Quaternion Function Reference

X/Y/Z

X, Y, Z components of a quaternion

Syntax

r = x(q), r = y(q), r = z(q)

Description

These three functions extract the three components of the vector part of a quaternion. The result is a real (or a complex value if the quaternion has complex components).

Examples

>> q = quaternion(1, 2, 3, 4)
 
q =  +1 +2 I +3 J +4 K
 
>> y(q)

ans =  3

>> q = randq(2)
 
q = 2x2 quaternion array
 
>> x(q)

ans =

   -0.2900   -0.1664
    0.2511   -0.2816

See Also

QTFM functions: s, scalar, v, vector, part

© 2008-2013 Stephen J. Sangwine and Nicolas Le Bihan

License terms.