  The Schr\"odinger equation in a square or rectangle with hard walls is solved
in every introductory quantum mechanics course. Solutions for other polygonal
enclosures only exist in a very restricted class of polygons, and are all based
on a result obtained by Lam\'e in 1852. Any enclosure can, of course, be
addressed by finite element methods for partial differential equations. In this
paper, we present a variational method to approximate the low-energy spectrum
and wave-functions for arbitrary convex polygonal enclosures, developed
initially for the study of vibrational modes of plates. In view of the recent
interest in the spectrum of quantum dots of two dimensional materials,
described by effective models with massless electrons, we extend the method to
the Dirac-Weyl equation for a spin-1/2 fermion confined in a quantum billiard
of polygonal shape, with different types of boundary conditions. We illustrate
the method's convergence in cases where the spectrum in known exactly and apply
it to cases where no exact solution exists.
