|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTurtle
A5
public class A5
Assignment A5
Constructor Summary | |
---|---|
A5()
Constructor: a black turtle starting at the middle of the panel with angle 0 (looking east). |
Method Summary | |
---|---|
void |
drawGreenHex(int d)
Draw six green equilateral triangles with side lengths d to form a hexagon, starting at the turtle's current position and angle. |
void |
drawH(double x,
double y,
double s)
Draw an H at center (x, y) of size s. |
void |
drawPolygon(int n,
int d)
Draw an n-sided polygon, ending up with the turtle being where it started out and facing the same direction, and with the pen properties the same, too. |
void |
drawSpiral(int ms,
int n,
int ang,
int d)
Draw a spiral of n lines, beginning at the current turtle position and angle, using an angle of ang between adjacent lines and pausing ms milliseconds after each line. |
void |
drawSpiralMid(int ms,
int n,
int ang,
int d)
Do as in drawSpiral but clear screen and start at the center of the panel and angle 0. |
void |
drawTriangle(int e,
Color c)
Draw an equilateral triangle of side length e and color c at the turtle's current position. |
void |
drawTwoLines()
Draw a black line 30 pixels to the right (east) and then a blue line 35 pixels down (south). |
void |
fillSquare(double s)
Fill a square of size (s, s), with top-left corner at the turtle's position. |
static Color |
HSV2RGB(HSV HSV)
= color in RGB color space formulae from http://en.wikipedia.org/wiki/HSV_color_space |
void |
multiPolygons(int m,
int n,
int d)
Draw 90 n-sided polygons of side length d, alternating between blue and red. |
void |
placeInCenter()
Place the turtle in the center of the panel, facing east, and clear the window (make it white). |
void |
radiate(int m,
int n,
int d)
Draw n straight radiating lines of length d at equal angles. |
void |
radiateMid(int m,
int n,
int d)
Do as in radiate but clear screen and start at center of panel and angle 0. |
void |
recursiveH(double x,
double y,
int d,
double s)
Make the graphics panel as big as possible, clear the panel, and draw an H-tree of depth d with center (x, y) and size s. |
void |
recursiveH1(double x,
double y,
int d,
double s)
draw an H-tree of depth d with center (x, y) and size s. |
void |
sierpinski(double x,
double y,
int d,
double s)
Make the graphics panel as big as possible, clear the panel, and draw a Sierpinksi triangle of depth d with side length s with the bottom left corner (x,y). |
void |
sierpinskicarpet(double x,
double y,
int d,
double s)
Make the graphics panel as big as possible, clear the panel, and draw a Sierpinksi carpet of depth d with side length s. |
String |
toString()
= a representation of this Turtle, giving its position, the angle, it is facing, whether the pen is down, and its color. |
Methods inherited from class Turtle |
---|
addAngle, clear, drawCircle, drawRect, fillCircle, fillRect, fillTriangle, getAngle, getColor, getCommands, getHeight, getWidth, getX, getY, intColor, isPenDown, jumpTo, moveAhead, moveBack, pause, putPenDown, putPenUp, setAngle, setColor, setPanelSize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public A5()
Method Detail |
---|
public void drawTwoLines()
public void placeInCenter()
public String toString()
toString
in class Object
public void drawTriangle(int e, Color c)
public void drawGreenHex(int d)
public void drawSpiralMid(int ms, int n, int ang, int d)
public void drawSpiral(int ms, int n, int ang, int d)
public void radiateMid(int m, int n, int d)
public void radiate(int m, int n, int d)
public static Color HSV2RGB(HSV HSV)
public void drawPolygon(int n, int d)
public void multiPolygons(int m, int n, int d)
public void sierpinski(double x, double y, int d, double s)
public void sierpinskicarpet(double x, double y, int d, double s)
public void fillSquare(double s)
public void drawH(double x, double y, double s)
public void recursiveH(double x, double y, int d, double s)
public void recursiveH1(double x, double y, int d, double s)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |