# Examples from pyvista.Transform.compose
# =======================================

# Define an arbitrary 4x4 affine transformation matrix and compose it.
import pyvista as pv
array = [
    [0.707, -0.707, 0, 0],
    [0.707, 0.707, 0, 0],
    [0, 0, 1, 1.5],
    [0, 0, 0, 2],
]
transform = pv.Transform().compose(array)
transform.matrix

# Define a second transformation and use `*` to compose it.
array = [[1, 0, 0], [0, 0, -1], [0, -1, 0]]
transform = transform * array
transform.matrix

# Compose the transform about a point. Check the `matrix_list` to see that a
# translation is added before and after the transform.
transform = pv.Transform().compose(transform, point=(1, 2, 3))
transform.matrix_list

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

