In 2013, Gau and Wu introduced a unitary invariant, denoted by k(A), of an n×n matrix A, which counts the maximal number of orthonormal vectors xj such that the scalar products 〈Axj,xj〉 lie on the boundary of the numerical range W(A). We refer to k(A) as the Gau–Wu number of the matrix A. In this paper we take an algebraic geometric approach and consider the effect of the singularities of the base curve, whose dual is the boundary generating curve, to classify k(A). This continues the work of Wang and Wu [14] classifying the Gau–Wu numbers for 3×3 matrices. Our focus on singularities is inspired by Chien and Nakazato [3], who classified W(A) for 4×4 unitarily irreducible A with irreducible base curve according to singularities of that curve. When A is a unitarily irreducible n×n matrix, we give necessary conditions for k(A)=2, characterize k(A)=n, and apply these results to the case of unitarily irreducible 4×4 matrices. However, we show that knowledge of the singularities is not sufficient to determine k(A) by giving examples of unitarily irreducible matrices whose base curves have the same types of singularities but different k(A). In addition, we extend Chien and Nakazato's classification to consider unitarily irreducible A with reducible base curve and show that we can find corresponding matrices with identical base curve but different k(A). Finally, we use the recently-proved Lax Conjecture to give a new proof of a theorem of Helton and Spitkovsky [5], generalizing their result in the process.