mindsponge.common.rots_mul_vecs

View Source On Gitee
mindsponge.common.rots_mul_vecs(m, v)[source]

Apply rotations \(\vec m = (m_0, m_1, m_2, m_3, m_4, m_5, m_6, m_7, m_8)\) to vectors \(\vec v = (v_0, v_1, v_2)\).

\[out = m \cdot v^T = (m_0 \times v_0 + m_1 \times v_1 + m_2 \times v_2, m_3 \times v_0 + m_4 \times v_1 + m_5 \times v_2, m_6 \times v_0 + m_7 \times v_1 + m_8 \times v_2)\]
Parameters
  • m (tuple) – rotations \(\vec m\) , length is 9. Data type is constant or Tensor with same shape.

  • v (tuple) – vectors \(\vec v\) , length is 3. Data type is constant or Tensor with same shape.

Returns

tuple, vectors after rotations.

Supported Platforms:

Ascend GPU

Examples

>>> import mindsponge
>>> m = (1, 2, 3, 4, 5, 6, 7, 8, 9)
>>> v = (1, 2, 3)
>>> v1 = mindsponge.common.rots_mul_vecs(m, v)
>>> print(v1)
(14, 32, 50)