A generalized infinite element is presented by combining following aspects: (1) The geometry mapping in the Cartesian system is chosen so as to facilitate the generation of infinite element mesh; (2) The decay variable is defined as the in situ major axis of the confocal ellipse where the field point is located, so it is dependent not only on the infinite-directional coordinate but on the finite-directional one(s); (3) The shape function is constructed so that it exactly satisfies the multipole expansion along the edges of the infinite element; (4) The conjugated weighting function is adopted to eliminate the harmonic terms from the integrands; and (5) the more proper form of phase factor and weighting factor is recommended. Compared with the Bettess element and the Astley element, the present element greatly reduces the element number within the finite element zone for problems with a large aspect ratio. Compared with the Burnett element and the modified Burnett element, the present element permits the free orientation of the infinite element, and thereby is suitable for more general exterior problems, either of a closed surface (source) or of an opening surface (source). Several typical examples are given and their results show that the generalized infinite element is robust and flexible.