*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 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 , 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,

For any integer *n* with , the maximum value of *d* is given by:

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 to be *x*, which is of the circle, or radians.

Let *y* be the angle such that

.. whence here , therefore .

As is isosceles, , and ; therefore

.. whence here .

Next, , in our case , thus the measure of can be found:

In our case .

By the sine law in ,

Or,

Simplifying, we get

We defined that and that , thus we write *y*:

And that brings us to the final formula:

Evaluating it for our star, we find that if , then .

### 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:

*(broken link removed)*

Or the source as a Netbeans project:

Do whatever you want with them, and have fun!

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.

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

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!

thanks so much, the assignment was in fact assigned again

thanks so much, the assignment was in fact assigned again

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!

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.

Life saver.. thanks a bunch! :)

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

SO HELPFUL

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

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

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

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

Hey sorry,

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

Can you re upload it?

I’ve reuploaded it.

There have been some issues with file hosting lately. http://luckytoilet.wordpress.com/2011/03/31/calling-for-a-new-file-host-for-this-blog-and-how-drop-io-failed-me/

Thank you, thank you, thank you! You’ve saved my life! :)

-An IB student from Spain

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

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

I can’t find one either! Please help!

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

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

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

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

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

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

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!!(:

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.

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

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!

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

It says “Windows does not recognize the file type”

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

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