matrix_from_shear

compas.geometry.matrix_from_shear(angle, direction, point, normal)[source]

Constructs a shear matrix by an angle along the direction vector on the shear plane (defined by point and normal).

Parameters
  • angle (float) – The angle in radians.

  • direction (list of float) – The direction vector as list of 3 numbers. It must be orthogonal to the normal vector.

  • point (list of float) – The point of the shear plane as list of 3 numbers.

  • normal (list of float) – The normal of the shear plane as list of 3 numbers.

Raises

ValueError – If direction and normal are not orthogonal.

Notes

A point P is transformed by the shear matrix into P” such that the vector P-P” is parallel to the direction vector and its extent is given by the angle of P-P’-P”, where P’ is the orthogonal projection of P onto the shear plane (defined by point and normal).

Examples

>>> angle = 0.1
>>> direction = [0.1, 0.2, 0.3]
>>> point = [4, 3, 1]
>>> normal = cross_vectors(direction, [1, 0.3, -0.1])
>>> S = matrix_from_shear(angle, direction, point, normal)