# Examples from pyvista.Transform.shear_matrix
# ============================================

# Compose a symmetric shear matrix.
import numpy as np
import pyvista as pv
shear = np.eye(4)
shear[0, 1] = 0.1
shear[1, 0] = 0.1
trans = pv.Transform(shear)

# Get the shear matrix. The shear matrix is the same as the input in this particular example,
# but in general this is not the case.
trans.shear_matrix

# Compose an asymmetric shear matrix instead.
shear = np.eye(4)
shear[0, 1] = 0.1
trans = pv.Transform(shear)

# Get the shear matrix. In this case, shear differs from the input because asymmetric shear
# can be decomposed into scale factors and a rotation.
trans.shear_matrix

trans.scale_factors

axis, angle = trans.rotation_axis_angle
axis
angle

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

