# Internal angle formula of a generalized polygon as a function of side length and apothem

I am looking to compute the internal angle of a generalized regular polygon (spherical, euclidean, or hyperbolic) as a function of its apothem and side length. I know the equation for a euclidean polygon: $\theta = 2 \tan^{-1} \frac{2a}{s}$*, however this equation does not hold up for non-euclidean polygons.

My motivation is to use this formula to create hyperbolic polygons in crochet (My previous question asked about hyperbolic crochet as well. Notice a trend?) using the granny square technique, and eventually tile them together. The apothem is equivalent to the number of rows, and side length to the number of stitches in each row.

Thank you!

$$\theta = \frac{(n - 2)180}{n}, \quad a = \frac{s}{2\tan \frac{180}{n}}$$ or just draw a picture

edit: I think I solved the hyperbolic formula: $\theta = 2 \tan^{-1} \frac{\tanh a}{\sinh 1/2 s}$. It looks very similar to the euclidean formula which is promising. The spherical equation is giving me problems based on the way arc lengths are measures.

-