Question: Please write this program in C++ on Sierpinski triangles, thank you so much!!! Background The Sierpinski Triangle is a fractal (i.e., a self-similar pattern)with the

Please write this program in C++ on Sierpinski triangles, thank you so much!!!

Background

The Sierpinski Triangle is a fractal (i.e., a self-similar pattern)with the overall shape of a triangle, subdivided recursively into smaller triangles.

In other words, a Sierpinski triangle is composed of three Sierpinski triangles, each of which is composed of three Sierpinski triangles, and so on

Assignment:

You shall write a C++ program that accepts 5 command-line arguments and generates an image of a Sierpinski triangle, as raw 32-bit RGBA pixels on standard output.

The command-line arguments shall consist of the following:

The width (in pixels) of the image, as a decimal integer

The height (in pixels) of the image, as a decimal integer

The background color, as a 32-bit little-endian hexadecimal integer

The foreground (drawing) color, as a 32-bit little-endian hexadecimal integer

The minimum area (in pixels) that a triangle must have in order to be drawn, as a decimal floating-point value.

The vertices for the outermost Sierpinski triangle shall be the middle of the top row, the bottom left corner, and the bottom right corner of the image.

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!