Computing the equations of a variety