mindsponge.common.rots_mul_rots

View Source On Gitee
mindsponge.common.rots_mul_rots(x, y)[source]

Get result of rotation matrix x multiply rotation matrix y.

\[\begin{split}\begin{split} &xx = xx1*xx2 + xy1*yx2 + xz1*zx2 \\ &xy = xx1*xy2 + xy1*yy2 + xz1*zy2 \\ &xz = xx1*xz2 + xy1*yz2 + xz1*zz2 \\ &yx = yx1*xx2 + yy1*yx2 + yz1*zx2 \\ &yy = yx1*xy2 + yy1*yy2 + yz1*zy2 \\ &yz = yx1*xz2 + yy1*yz2 + yz1*zz2 \\ &zx = zx1*xx2 + zy1*yx2 + zz1*zx2 \\ &zy = zx1*xy2 + zy1*yy2 + zz1*zy2 \\ &zz = zx1*xz2 + zy1*yz2 + zz1*zz2 \\ \end{split}\end{split}\]
Parameters
  • x (tuple) – rots x, \((xx1, xy1, xz1, yx1, yy1, yz1, zx1, zy1, zz1)\).

  • y (tuple) – rots y, \((xx2, xy2, xz2, yx2, yy2, yz2, zx2, zy2, zz2)\).

Returns

tuple, the result of rots x multiplying rots y. The result is \((xx, xy, xz, yx, yy, yz, zx, zy, zz)\).

Supported Platforms:

Ascend GPU

Examples

>>> from mindsponge.common.geometry import rots_mul_rots
>>> rtos_0 = (1, 1, 1, 1, 1, 1, 1)
>>> rtos_1 = (1, 1, 1, 1, 1, 1, 1)
>>> result = rots_mul_rots(rots_0, rots_1)
>>> print(output)
(3, 3, 3, 3, 3, 3, 3, 3, 3)