def shear_matrix(angle, direction, point, normal):
 normal = unit_vector(normal[:3])
 direction = unit_vector(direction[:3])
 if (abs(numpy.dot(normal, direction)) > 1e-06):
  raise ValueError('direction and normal vectors are not orthogonal')
 angle = math.tan(angle)
 M = numpy.identity(4)
 M[:3, :3] += (angle * numpy.outer(direction, normal))
 M[:3, 3] = (((- angle) * numpy.dot(point[:3], normal)) * direction)
 return M

def shear_matrix ( angle , direction , point , normal ) : normal = unit_vector ( normal [ : 3 ] ) direction = unit_vector ( direction [ : 3 ] ) if ( abs ( numpy . dot ( normal , direction ) ) > 1e-06 ) : raise ValueError ( 'direction and normal vectors are not orthogonal' ) angle = math . tan ( angle ) M = numpy . identity ( 4 ) M [ : 3 , : 3 ] += ( angle * numpy . outer ( direction , normal ) ) M [ : 3 , 3 ] = ( ( ( - angle ) * numpy . dot ( point [ : 3 ] , normal ) ) * direction ) return M
return matrix to shear by angle along direction vector on shear plane .