| 52 | } |
| 53 | |
| 54 | int main() { |
| 55 | // This will generate a Sierpinski triangle with a chaos game of n points for |
| 56 | // an initial triangle with three points on the vertices of an equilateral |
| 57 | // triangle. |
| 58 | PointVector inputPoints = {{0.0, 0.0}, {0.5, std::sqrt(0.75)}, {1.0, 0.0}}; |
| 59 | auto outputPoints = chaosGame(10000, inputPoints); |
| 60 | |
| 61 | // It will output the file sierpinski.dat, which can be plotted after |
| 62 | std::ofstream ofs("sierpinski.dat"); |
| 63 | for (auto pt : outputPoints) |
| 64 | ofs << pt.x << '\t' << pt.y << '\n'; |
| 65 | } |
nothing calls this directly
no test coverage detected