c4dynamics.states.lib.quatbody.quatbody.quat#
- property quatbody.quat#
Gets and sets the attitude quaternion.
\[quat = [q_w, q_x, q_y, q_z]\]The quaternion is scalar first (Hamilton convention). A set quaternion is normalized to a unit quaternion.
- Parameters:
quat (numpy.array or list) – A quaternion \([q_w, q_x, q_y, q_z]\).
- Returns:
out (numpy.array) – The attitude quaternion \([q_w, q_x, q_y, q_z]\).
Examples
>>> qb = c4d.quatbody(phi = 90 * c4d.d2r) >>> qb.quat [0.707 0.707 0 0]
>>> qb.quat = [1, 0, 0, 1] >>> qb.quat [0.707 0 0 0.707] >>> qb.angles * c4d.r2d [0 0 90]