mindsponge.common.rigids_from_3_points

View Source On Gitee
mindsponge.common.rigids_from_3_points(point_on_neg_x_axis, origin, point_on_xy_plane)[source]

Gram-Schmidt process. Create rigids representation of 3 points local coordination system, point on negative x axis A, origin point O and point on x-y plane P.

First calculate the coordinations of vector AO and OP. Then use rots_from_two_vecs get the rotation matrix.

Distance between origin point O and the origin point of global coordinate system is the translations of rigid.

Finally return the rotations and translations of rigid.

Reference:

Jumper et al. (2021) Suppl. Alg. 21 ‘Gram-Schmidt process’.

v1=x3x2v2=x1x2e1=v1/||v1||u2=v2e1(e1Tv2)e2=u2/||u2||e3=e1×e2rotation=(e1,e2,e3)translation=(x2)
Parameters
  • point_on_neg_x_axis (tuple) – point on negative x axis A, length is 3. Data type is constant or Tensor with same shape.

  • origin (tuple) – origin point O, length is 3. Data type is constant or Tensor with same shape.

  • point_on_xy_plane (tuple) – point on x-y plane P, length is 3. Data type is constant or Tensor with same shape.

Returns

tuple(rots, trans), rigid, 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)
>>> O = (4, 6, 8)
>>> P = (5, 8, 11)
>>> ans = mindsponge.common.rigids_from_3_points(A, O, P)
>>> print(ans)
((0.4242640686695021, -0.808290367995452, 0.40824828617045156, 0.5656854248926695,
 -0.1154700520346678, -0.8164965723409039, 0.7071067811158369, 0.5773502639261153,
 0.4082482861704521), (4,6,8))