Calculate the tangent space.