In this paper we show how to associate to any real projective algebraic varietyZ⊂RPn−1a real polynomialF1:Rn,0 →R, 0 with an algebraically isolated singularity, having the property that χ(Z) = ½(1 − deg (gradF1), where deg (gradF1is the local real degree of the gradient gradF1:Rn, 0 →Rn, 0. This degree can be computed algebraically by the method of Eisenbud and Levine, and Khimshiashvili [5]. The varietyZneed not be smooth.This leads to an expression for the Euler characteristic of any compact algebraic subset ofRn, and the link of a quasihomogeneous mappingf:Rn, 0 →Rn, 0 again in terms of the local degree of a gradient with algebraically isolated singularity.Similar expressions for the Euler characteristic of an arbitrary algebraic subset ofRnand the link of any polynomial map are given in terms of the degrees of algebraically finite gradient maps. These maps do involve ‘sufficiently small’ constants, but the degrees involved ar (theoretically, at least) algebraically computable.