This paper presents a methodology to calculate the value of Carter's factor for airgaps with polygonal slots. A numerical evaluation of the Schwarz-Christoffel transformation is performed using Genetic Algorithms. The methodology presented here extends Carter's method to airgaps with more complicated geometry. Some case studies compare the results of the developed methodology to Carter's results.