mindsponge.common.make_transform_from_reference
- mindsponge.common.make_transform_from_reference(point_a, point_b, point_c)[source]
Using GramSchmidt process to construct rotation and translation from given points.
Calculate the rotation matrix and translation meets
point_b is the original point.
point_c is on the x_axis.
the plane a-b-c is on the x-y plane.
- Parameters
- Returns
Tuple, rots
, the shape of every element is .Tuple, trans
, the shape of every element is .
- Supported Platforms:
Ascend
GPU
Examples
>>> import numpy as np >>> import mindspore as ms >>> from mindspore import Tensor >>> from mindsponge.common.geometry import make_transform_from_reference >>> input_0 = Tensor(np.ones((4, 256, 3)), ms.float32) >>> input_1 = Tensor(np.ones((4, 256, 3)), ms.float32) >>> input_2 = Tensor(np.ones((4, 256, 3)), ms.float32) >>> rots, trans = make_transform_from_reference(input_0, input_1, input_2) >>> print(len(rots), rots[0].shape, len(trans), trans[0].shape) 9, (4, 256), 3, (4, 256)