Let $W$ be a closed algebraic subvariety of the $n$-dimensional projective space over the complex or real numbers and suppose that $W$ is non-empty and equidimensional. In this paper we generalize the classic notion of polar variety of $W$ associated with a given linear subvariety of the ambient space of $W$. As particular instances of this new notion of generalized polar variety we reobtain the classic ones and two new types of polar varieties, called dual and (in case that $W$ is affine) conic. We show that for a generic choice of their parameters the generalized polar varieties of $W$ are empty or equidimensional and, if $W$ is smooth, that their ideals of definition are Cohen-Macaulay. In the case that the variety $W$ is affine and smooth and has a complete intersection ideal of definition, we are able, for a generic parameter choice, to describe locally the generalized polar varieties of $W$ by explicit equations. Finally, we use this description in order to design a new, highly efficient elimination procedure for the following algorithmic task: In case, that the variety $W$ is $\Q$-definable and affine, having a complete intersection ideal of definition, and that the real trace of $W$ is non-empty and smooth, find for each connected component of the real trace of $W$ a representative point.