coords.Coords.transform_coordsys#
- Coords.transform_coordsys(cs, cs0=None)#
Perform a coordinate system transformation on the
Coords.This method transforms the Coords object by the transformation that turns one coordinate system into a another.
Parameters#
- cs:
CoordSys The final coordinate system.
- cs0:
CoordSys, optional The initial coordinate system. If not provided, the global coordinate system is used.
Returns#
- Coords
The input Coords transformed by the same affine transformation that turns the axes of the coordinate system cs0 into those of the system cs.
See Also#
to_coordsys(): transform coordinates to another CSfrom_coordsys(): transfrom coordinates from another CS
Examples#
>>> X = Coords([[0.0, 0.0, 0.0],[2.0, 2.0, 0.0]]) >>> print(X) [[0. 0. 0.] [2. 2. 0.]] >>> from hellotriangle.coordsys import CoordSys >>> CS = CoordSys(oab=[[0.5, 0.5, 0.0], [1.0, 0.5, 0.0], [0.5, 1.0, 0.0]]) >>> print(CS) CoordSys: trl=[0.5 0.5 0. ]; rot=[[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]] >>> print(X.transform_coordsys(CS)) [[0.5 0.5 0. ] [2.5 2.5 0. ]]
- cs: