z#
- QuaternionArray.z#
Third elements of the vector part of all Quaternions.
Having the quaternion elements \(\mathbf{q}_i=\begin{pmatrix}w_i & \mathbf{v}_i\end{pmatrix}=\begin{pmatrix}w_i & x_i & y_i & z_i\end{pmatrix}\in\mathbb{R}^4\) stacked vertically in an \(N\times 4\) matrix \(\mathbf{Q}\):
\[\begin{split}\mathbf{Q} = \begin{bmatrix} \mathbf{q}_0 \\ \mathbf{q}_1 \\ \vdots \\ \mathbf{q}_{N-1} \end{bmatrix} = \begin{bmatrix} w_0 & x_0 & y_0 & z_0 \\ w_1 & x_1 & y_1 & z_1 \\ \vdots & \vdots & \vdots & \vdots \\ w_{N-1} & x_{N-1} & y_{N-1} & z_{N-1} \end{bmatrix}\end{split}\]The third elements of the vector parts of all quaternions are:
\[\mathbf{z} = \begin{bmatrix}z_0 & z_1 & \cdots & z_{N-1}\end{bmatrix}\]- Returns:
z – Third elements of the vector part of all quaternions.
- Return type:
numpy.ndarray
Examples
>>> Q = QuaternionArray(np.random.random((3, 4))-0.5) >>> Q.view() QuaternionArray([[ 0.39338362, -0.29206111, -0.07445273, 0.86856573], [ 0.65459935, 0.14192058, -0.69722158, 0.25542183], [-0.42837174, 0.85451579, -0.02786928, 0.29244439]]) >>> Q.z array([0.86856573, 0.25542183, 0.29244439])
They can also be accessed directly, returned as a QuaternionArray:
>>> Q[:, 3] QuaternionArray([0.86856573, 0.25542183, 0.29244439])