# Investigations on star polygons with a star polygon / stellar number generator

Note 9/3/2010: Redone all of the diagrams

If you are just looking for a download link to the program, here it is. To run, save as Stellar.jar (Java is required)

As school has been over for more than a week now, I’ve had time to (among other things) study geometry. I’m just spending an hour or two every day working through various exercises in Geometry Revisited.

This blog post is long overdue; it had been sitting in my drafts section with a few sentences written since the middle of April. Maybe it’s still useful now, maybe not. Anyways.

I myself am not in IB, because of my hatred of being forced to do copious and tedious amounts of homework. Many of my friends, however, take IB math. One famous project in IB math (not only in my school, but also in other schools) is a large project known as the math portfolio. From what I’ve heard, this consists of a dozen or so pages of writeup on some extended problem.

I first heard about the existence of such a project when a few of my friends asked me for help on it. The project was related to ‘stellar numbers’; a picture of the assignment can be found here. The problem itself seems rather trivial, thus I don’t feel it necessary to discuss it in this blog post.

My investigations here, although inspired by this assignment, is only marginally related to the assignment itself. The end product to be handed in for grades was supposed to include diagrams. However, it isn’t so easy to draw diagrams of stars (see above image) either by hand or on the computer. I saw many of my friends hastily put together their diagrams of stars using Powerpoint or MS Word, using the line and circle tools and a heck lot of copy-and-pasting. The result, unsurprisingly, is messy and inexact. One friend of mine wrote a computer program to output Latex code to draw the stars; the details of how this is done is something I consider more difficult and interesting than the project itself.

Keeping along with my theme of geometry this week, it is useful to figure out the geometry of star polygons before writing programs to generate them.

### Some geometric constructions

Consider the five sider star (fig.1):

We can see that the five corners of the star, ABCDE, are the same distance from the center K of the star. This means the five points lie on a circle; furthermore the distances between the corners are the same.

A similar phenomenon occurs with the five points between the corners, FGHIJ. They, too, lie on a circle centered around K.

Let us call the radius of the larger circle r, and the radius of the smaller circle i. Any star can be built around the framework of two circles. For example, our five pointed star (fig.2):

There is, however, one more characteristic present in star polygons that we neglected in the above diagram. It is that we chose the values of r and i pretty much arbitrarily.

Notice that in (fig.1), the sides EF and GB are parallel. It can be shown geometrically that if parallel, EF and GB are also concurrent. In (fig.2), EF and GB are not parallel nor concurrent.

Although any values of i and r for $i are enough to produce a star, it is necessary to further adjust the ratio between i and r in order to produce a correct star polygon.

Let us denote n to mean the number of points of a star, and d to denote the density of a star.

What do we mean by density? In order to define density, we will take a step back and take a look at alternative ways that star polygons can be constructed.

At present we are looking at star polygons as points on two distinct circles joined together with alternating line segments. Here is a completely different way of presenting it (fig.3):

Points ABCDE are spread equally on a circle. For the five points, every two points are connected by a line. We define density to be this number: the density for this star is 2.

It is possible, perhaps easier, to implement a drawing routine this way. However, by doing this we would have to erase the lines FGHIJ, which seems straightforward but is troublesome in implementation. We are going to stick to the two circles paradigm.

If $d=1$, then our ‘star’ would be degenerate; it would merely be a n-sided polygon. On the other hand, we assume that the inner circle has positive radius, thus,

$d < \frac{n}{2}$

For any integer n with $n \geq 3$, the maximum value of d is given by:

$d \leq \lfloor \frac{n-1}{2} \rfloor$

Next is finding a way to express the ratio between the radii in terms of n and d.

Here we combined the previous two diagrams, and added some new lines. Since our star contains so much symmetry, what follows can be extended to all corners of the star, and also to stars with different densities and number of corners.

Let us call the angle $\angle EKA$ to be x, which is $\frac{1}{n}$ of the circle, or $\frac{2 \pi}{n}$ radians.

Let y be the angle such that

$x:x+y = 1:d$

.. whence here $d=2$, therefore $x=y=72^\circ$.

As $\triangle EKB$ is isosceles, $\angle BEK = \angle EBK$, and $\angle BEK + \angle EBK + x + y = 180^\circ$; therefore

$\angle BEK = \frac{1}{2}\left[ 180-(x+y) \right] = 90-\frac{1}{2}(x+y)$

.. whence here $\angle BEK = 18^\circ$.

Next, $\angle EKL = \frac{1}{2}x$, in our case $36^\circ$, thus the measure of $\angle EFK$ can be found:

$\angle EFK = 180 - \left[ 90-\frac{1}{2}(x+y) \right] - \frac{1}{2}x = 90 + \frac{1}{2}y$

In our case $\angle EFK = 126^\circ$.

By the sine law in $\triangle EKF$,

$\frac{r}{\sin (90 + \frac{1}{2}y)} = \frac{i}{\sin \left[90-\frac{1}{2}(x+y) \right]}$

Or,

$i = \frac{r \sin \left[90-\frac{1}{2}(x+y) \right]}{\sin (90 + \frac{1}{2}y)}$

Simplifying, we get

$i = \frac{r \cos \left[ \frac{1}{2}(x+y) \right]}{\cos (\frac{1}{2}y)}$

We defined that $x = \frac{2 \pi}{n}$ and that $x+y = \frac{2 \pi d}{n}$, thus we write y:

$y=\frac{2 \pi (d-1)}{n}$

And that brings us to the final formula:

$i = \frac{r \cos (\frac{\pi d}{n})}{\cos \left[ \frac{\pi (d-1)}{n} \right]}$

Evaluating it for our star, we find that if $r=1$, then $d \approx 0.38197$.

### Implementation in Java

Now that we have the math done, it is a fairly easy programming exercise to implement this as a java application. Here’s what I came up with after ~2 hours of hacking in Netbeans (animated gif):

This may be useful to future people doing the same assignment (if it ever gets assigned again), or with modifications it may be useful for other purposes too.

To use it, adjust the settings, take a screenshot, crop it, and it may be necessary to further edit it in photoshop.

Without further ado, here’s the application as a jar file:

Or the source as a Netbeans project:

stellar-src.zip (37kb)

Do whatever you want with them, and have fun!

## 35 thoughts on “Investigations on star polygons with a star polygon / stellar number generator”

1. James says:

Dear stranger who wrote the mathematical program,

Thank you. You have been an immense help to me for my Type 1 IB Math Portfolio. I have saved hours of drawing manually thanks to your program.

2. newyork_devil says:

hey i use mac and i can’t run your program what should i do?

1. Anonymous says:

Hi there!
Well I don’t know why but I cannot download the program. I really need it!! it says ”The drop.io service has been discontinued”. Please help me! it’s a really important project and I’m not very good at drawing so I need your awesome program.

Thank you in advance!

3. Anonymous says:

thanks so much, the assignment was in fact assigned again

4. alex says:

thanks so much, the assignment was in fact assigned again

5. hey thanks so much for the explanation. i am encountering a problem when i try to download the jar file. it says that 1000 downloads have already been made. is there anyway to get around this? i really need the program! thanks so much!

6. Sorry, I was unaware that drop.io had a limit of 1000 downloads. I’ve reuploaded the file, and made four mirrors of it. Cheers.

7. Life saver.. thanks a bunch! 🙂

8. OOoh just one problem though – how do I put this onto Word?

9. Sam says:

10. IBvictim says:

You just saved MY life!!!! Thank you so much it was EXTREMELY helpful

11. Fello' says:

Eh, I wished I’d known of this source prior to spending approx. two hours recreating stellar shapes.

12. Hasanain says:

Hi, are your links to download the program broken? Because I cannot open them. It keeps sending a “page load” error

1. Hmm, yea the first link doesn’t seem to work anymore. Mirror 1 and Mirror 2 seems to be working.

13. Claudio says:

Hey sorry,

I’m really interested in the source code for this program.

Can you re upload it?

14. Cristina says:

Thank you, thank you, thank you! You’ve saved my life! 🙂
-An IB student from Spain

15. lewis says:

your java program arouses me and is aesthetically pleasing in equal measure.
thank you for your worthwhile contribution to IB students worldwide,
this has been wildly helpful. just wondering, how could you create this… it is very hard to understand. especially since you are just out of school. you should be p’ed out at the side of the road

16. Anonymous says:

hey i cant seem to find where to download the java program to generate the stellar numbers..
can someone plleasseee link it to me?

Thanks a ton 🙂
Lily

1. John says:

17. Anonymous says:

Would appreciate it a lot if someone would tell me where to download this from??

18. Anonymous says:

ahhh the link on media fire does not work. any ideas as to why not? any other way to get it? i really need it for my stellar assignment

19. TheT says:

ahhh! it doesn’t work, the link on media fire for me. any other way to received it? i really need it for my math investigation. pleasssee help me

20. Procrastinator says:

You sir, have just won 10 million internetz for giving me the gift of sleep.

21. auburrito says:

it wont let me save the picute… any advice… D:

22. Anonymous says:

Hello if anyone can tell me where i can down load that java program form?? thanks a lot!!

23. Anonymous says:

THANKYOUSOMUCH! i absolutely love this program, and i got a 100 on my precalculus IB paper!! it saved me so much time because i didn’t have to draw everything out by hand. your explanation also makes PERFECT sense unlike any other essay on the entire internet. once again, THANKYOUILOVEYOU!!(:

24. Great work!! I have done that portfolio for the IB when I was in my first year. Then I choose HL Maths so I made other portfolios. Since then I have been investigating a little about stellar numbers, poligonal numbers, thetraedrical numbers, the relations with the pascal triangle and more… and that app would help me a lot.
The file is no longer available. Could you upload it again? Thanks so much in advance.

25. Oh no, the download link broke again! Thanks, fixed.

26. Thanks!! And another thing: some of the problems you post in this blog are very good. Solving it, or at least, try to solve it is so funny!! Thanks very much for the effort and continue like this!

27. Natalie says:

Can you help me please? I try to open it but it won’t let me. I’m not very computer savvy so I don’t know what’s wrong, but I really need this for my Math IA! I have Java

28. Natalie says:

It says “Windows does not recognize the file type”

29. Anonymous says:

nice website of information……………….Thank you so much.

30. green gooseman says:

thank you thank you thank you for saving my time and sanity ^_^