Gravity anomaly of polyhedral bodies having a polynomial density contrast