I am busy looking to create star paths in my app, and I was wondering how to determine the ratio between the inner radius and the outer radius of the points of a star so that the star has "straight" lines across.
I have a function that takes 3 parameters:
pointCount = 5
outerRadius = 100
innerRadius = 50
Basically it goes around the circle and alternates between a point and an inside so the star looks like this:

As you can see, the star is "bulging". What I am really trying to get is this star:
![]()
There should be some mathematical formula that can take the "outer" radius and the number of points to calculate the "inner" radius?
innerRadius = some_operation (pointCount, outerRadius)

I think you are trying to draw a pentagram. While the linked page has many properties of that shape, some of them which would be of interest to you are: $$R = \sqrt{\frac{1}{10}\big(25 - 11\sqrt{5}\big)} \\ \rho = \sqrt{\frac{1}{10}\big(5 - \sqrt{5}\big)}$$ where $R$ is the inner radius and $\rho$ is the outer radius. This assumes that the long edges of the star are of length 1.
You could always scale these numbers if the edges are not of length 1. But as you're interested in the ratio, we have $$\frac{\rho}{R} = \sqrt{\frac{5 - \sqrt{5}}{25 - 11\sqrt{5}}} = \frac{3 + \sqrt{5}}{2}$$ In addition to being a surprisingly clean simplification, note that the ratio is $\phi + 1$ where $\phi$ is the famous golden ratio!