pyxc.transform.affine2d
Module Contents
Classes
2-dimensional Affine transformation. |
- class pyxc.transform.affine2d.Affine2D(transformation_matrix: numpy.ndarray | None = None, parent: pyxc.transform.transform_base.MatrixTransformationBase | None = None)[source]
Bases:
pyxc.transform.transform_base.MatrixTransformationBase2-dimensional Affine transformation.
By calling each transformation method, such as translate(), corresponding transformation matrix is generated and queued in the transformation queue. The queued transformation entries are later compiled into a single matrix by calling the compile() method.
- Parameters:
- transformation_matrix
np.ndarray, optional The transformation matrix to be used for the transformation.
- parent
TransformationBase, optional The parent transformation object.
- transformation_matrix
Methods
translate(tx, ty)
rotate(angle)
shear_x(angle)
shear_y(angle)
scale(x_scale, y_scale)
flip_x()
flip_y()
flip_xy()
- translate(tx: float, ty: float)[source]
Transformation matrix.
- Parameters:
- Returns:
- np.ndarray:
Translation matrix.
See also
pyxc.transform.transform_base.TransformationCommon.queue_return_handlerPossible keyword arguments.
- rotate(angle: float)[source]
Rotation matrix.
- Parameters:
- angle
float Rotation angle in radian. Note: numpy.deg2rad() is the convenient method to convert degree to radian.
- angle
- Returns:
- np.ndarray:
Rotation matrix.
See also
pyxc.transform.transform_base.TransformationCommon.queue_return_handlerPossible keyword arguments.
- shear_x(angle: float)[source]
Shear transformation along the x-axis.
- Parameters:
- angle
float Shear angle in radian. Note: numpy.deg2rad() is the convenient method to convert degree to radian.
- angle
- Returns:
- np.ndarray:
Shear matrix along the x-direction.
See also
pyxc.transform.transform_base.TransformationCommon.queue_return_handlerPossible keyword arguments.
- shear_y(angle: float)[source]
Shear transformation along the y-axis.
- Parameters:
- angle
float Shear angle in radian. Note: numpy.deg2rad() is the convenient method to convert degree to radian.
- angle
- Returns:
- np.ndarray:
Shear matrix along the x-direction.
See also
pyxc.transform.transform_base.TransformationCommon.queue_return_handlerPossible keyword arguments.
- scaling(sx: float, sy: float)[source]
Scaling transformation matrix.
- Parameters:
- Returns:
- np.ndarray:
Scaling matrix along the x-direction.
See also
pyxc.transform.transform_base.TransformationCommon.queue_return_handlerPossible keyword arguments.
Notes
If sx = sy = 1, then the composed matrix is equal to the identity matrix.