Second Stage Star

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
Historical topic: Java appletsModern web browsers do not run Java applets. The Applet API was deprecated for removal before Java 25 and was removed in Java 26. Treat applet examples on this page as historical object-oriented/GUI examples; for new desktop interfaces use Swing where appropriate or JavaFX/OpenJFX.

Answer:

Yes. The applet that draws the single stars has calculated the endpoints of all these lines.

Second Stage Star

Here is an applet that extends the basic star by drawing another star centered at the tip of each of the six lines:

Embedded Java applet removed: modern browsers do not support Java applets. The surrounding source code is retained for historical study.

The new stars are drawn in red. Each new star partially overlaps a line of the central star. This could be avoided by doing more math, but the the overlap does not hurt.

QUESTION 10:

Can you think of a way to draw a star at the end of each line?