(programming required) Write a recursive function sierpinskiTriangle(level, length, x, y), in a language of your choice, to draw a Sierpinski triangle of side length length at level level with bottom-left coordinate hx, yi. (You’ll need to use some kind of graphics package with line-drawing capability.) Write your function so that—in addition to drawing the fractal—it returns both the total length and total area of the triangles that it draws. Use your function to verify some small cases of Exercises 5.15 and 5.18.
Exercises 5.15 and 5.18
5.18 Sierpinski triangle 5.19 Sierpinski carpet
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here