3D star geometry

For a project I want to be able to fill in a (even) number of “legs” for my star and calculate the necessary angles to create a 3D “star”. I want all the legs to be evenly spaced. Is there an algorithm for these kind of shapes? (I can’t seem to find the pattern) or is it impossible to describe these shapes with a formula? I have actually no idea what the correct name for this shape is so it’s hard to find any information. I’ve attached an example of a star with 8 “legs”.

I can’t help you with an algorithm but this could be a good starting point of research. Don’t hesitate to click on all the links in the page.