Question: Sierpinski Triangles. Write a recursive program to draw Sierpinski triangles (see program 2.2.3) as with Htree, use a command line argument to control the depth

Sierpinski Triangles. Write a recursive program to draw Sierpinski triangles (see program 2.2.3) as with Htree, use a command line argument to control the depth of the recursion.

this is program 2.2.3 (use sierpinski.txt) public class IFS { public static void main(String[] args) { int T=Integer.parseInt(args[0]); double[][]dist=StdArrayIO.

readDouble1D(); double[][]cx=StdArrayIO.readDouble2D(); double[][]cy=StdArrayIO.readDouble2D();

double x=0.0, y=0.0; for (int t=0; t

[2]; double y0=cy[r][0]*x+cy[r][1]*y+cy[r][2];

x=x0; y=y0; StdDraw.point(x,y); } } }

The questions come from the book Introduction to Programming in Java by Robert Sedgewick and Kevin Wayne. this is the book website if you need more info: http://introcs.cs.princeton.edu/java/home/ My IDE is Dr. java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!