Question
Write a program that lets the user to enter the order and displays the filled Sierpinski triangles as shown in figures below. A Sierpinski triangle
Write a program that lets the user to enter the order and displays the filled Sierpinski
triangles as shown in figures below. A Sierpinski triangle is created as follows:
1. Begin with an equilateral triangle, which is considered to be a Sierpinski fractal of
order (or level) 0, as shown in Figure 0.
2. Connect the midpoints of the sides of the triangle of order 0 to create a Sierpinski
triangle of order 1 (in Figure 1).
3. Leave the center triangle intact. Connect the midpoints of the sides of the three other
triangles to create a Sierpinski triangle of order 2 (Figure 2).
4. Repeat the same process recursively to create a Sierpinski triangle of order 3, 4, ...,
and so on (Figure 3).
erpinskiTrian.. SierpinskiTrian.. Enter an order ? Enter an order Figure 0 Figure 1 SierpinskiTrian.. SierpinskiTrian.. Enter an order Enter an order Figure 2 Figure 3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started