mindsponge.common.rigids_mul_rigids
- mindsponge.common.rigids_mul_rigids(a, b)[source]
Change rigid \(b\) from its local coordinate system to rigid \(a\) local coordinate system, using rigid rotations and translations.
Use the rotations calculated by multiplying rotations of rigid \(b\) and rigid \(a\) as new rotations of rigid \(b\) .
Multiply the translations of rigid \(b\) with rotations of rigid \(a\) , then add translations of rigid \(a\) . The translations got is new translations of rigid \(b\).
\[\begin{split}\begin{split} &r = a_rb_r \\ &t = a_rb_t +a_t \\ \end{split}\end{split}\]- Parameters
a (tuple) – rigid \(a\) . 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.
b (tuple) – rigid \(b\) . 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.
- Returns
tuple(rots, trans), rigid \(b\) changed. 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)) >>> b = ((2, 3, 4, 1, 5, 6, 3, 8, 7), (1, 2, 3)) >>> b1 = mindsponge.common.rigids_mul_rigids(a,b) >>> print(b1) ((13, 37, 37, 31, 85, 88, 49, 133, 139), (17, 36, 55))