KochSnowflake - KochSnowflake.java Author Lewis/Loftus...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//******************************************************************** // KochSnowflake.java Author: Lewis/Loftus // // Solution to Programming Project 11.10 // // Encapsulates the Koch Snowflake fractal. //******************************************************************** import java.awt.Dimension; import java.awt.Graphics; public class KochSnowflake extends RecursiveFractal { int order; private final int MAX_ORDER = 8; private final String name = "The Koch Snowflake"; private final int NUM_COORDINATES = 6; private final int TOPX = 0, TOPY = 1, LEFTX = 2, LEFTY = 3, RIGHTX = 4, RIGHTY = 5; private final int INSET = 20; private final int BORDER = 50; private final double SQ = Math.sqrt(3.0) / 6; public KochSnowflake() { order = 1; } //----------------------------------------------------------------- // Sets the fractal order to the value specified. //----------------------------------------------------------------- public void setOrder(int value) { if (value < 1) order = 1; else if (value > MAX_ORDER)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/17/2011 for the course COP 3530 taught by Professor Davis during the Spring '08 term at University of Florida.

Page1 / 3

KochSnowflake - KochSnowflake.java Author Lewis/Loftus...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online