coords.Coords.position#
- Coords.position(x, y)#
Position a
Coordsso that 3 points x are aligned with y.Aligning 3 points x with 3 points y is done by a rotation and translation in such way that
point x0 coincides with point y0,
line x0,x1 coincides with line y0,y1
plane x0,x1,x2 coincides with plane y0,y1,y2
Parameters#
- x: float array_like (3,3)
Original coordinates of three non-collinear points. These points can be be part of the Coords or not.
- y: float array_like (3,3)
Final coordinates of the three points.
Returns#
- Coords
The input Coords rotated and translated thus that the points x are aligned with y.
Notes#
This is a convenient shorthand for
self.affine(*trfmat(x, y)).See Also#
arraytools.trfmat(): compute the transformation matrices from points x to yaffine(): general transform using rotation and translation
Examples#
>>> X = Coords([[0,0,0],[1,0,0],[1,1,0]]) >>> Y = Coords([[1,1,1],[1,10,1],[1,1,100]]) >>> print(X.position(X,Y)) [[1. 1. 1.] [1. 2. 1.] [1. 2. 2.]]