mindsponge.common.invert_rigids
- mindsponge.common.invert_rigids(rigids)[source]
Computes group inverse of rigid transformations. Change rigid from local coordinate system to global coordinate system.
Use invert_rots to calculate the invert rotations of rigid. Then use rots_mul_vecs to rotate the translations of rigid. The opposite of the result is the translations of invert rigid.
\[\begin{split}\begin{split} &inv\_rots = r_r^T = (r_0, r_3, r_6, r_1, r_4, r_7, r_2, r_5, r_8) \\ &inv\_trans = -r_r^T \cdot r_t^T = (- (r_0 \times t_0 + r_3 \times t_0 + r_6 \times t_0), - (r_1 \times t_1 + r_4 \times t_1 + r_7 \times t_1), - (r_2 \times t_2 + r_5 \times t_2 + r_8 \times t_2)) \\ \end{split}\end{split}\]- Parameters
rigids (tuple) – rigids, including the rots and trans changing rigids from global coordinate system to local coordinate system.
- Returns
- tuple(rots, trans), group inverse of rigid transformations, length is 2. Include rots
\((xx, xy, xz, yx, yy, yz, zx, zy, zz)\) and trans \((x, y, z)\) . Data type is constant or Tensor with same shape.
- Supported Platforms:
Ascend
GPU
Examples
>>> import mindsponge >>> a = ((1, 2, 3, 4, 5, 6, 7, 8, 9), (3, 4, 5)) >>> inv_a = mindsponge.common.invert_rigids(a) >>> print(inv_a) ((1, 4, 7, 2, 5, 8, 3, 6, 9), (-54.0, -66.0, -78.0))