Shear
- class Shear(shear_angle: float, shear_factor: float)
A
Sheartransformation shears the plane by a givenshear_factor,f, preserving points on the line passing through(0, 0, 0)at a givenshear_angle,θ.This preserves areas but not lengths. In the future, it can be extended to shear planes other than the XY-plane.
To shear a square lattice from having a 90° angle between the lines parallel to
θand those perpendicular to a parallelogram lattice with a (90-α)° angle in its place, set theshear_factortotan(α). This is a more familiar representation for some people.Its matrix looks like:
┏ ┓ ┃ 1 - f*cos(θ)sin(θ) f*cos(θ)cos(θ) 0 0 ┃ ┃ -f*sin(θ)sin(θ) 1 + f*cos(θ)sin(θ) 0 0 ┃ ┃ 0 0 1 0 ┃ ┃ 0 0 0 1 ┃ ┗ ┛
Methods
Apply this
Shearto a vector.The inverse
HomogeneousTransformationof this one.- inverse()
The inverse
HomogeneousTransformationof this one.