Tan of shear factor in get_shear_matrix2d

Tan of shear factors is taken in get_shear_matrix2d function. It changes the shear factor from what is expected. What is the reason behind using tan in shear?

I assume it’s the general formula for the shear matrix as described in this simple example.