Koch curve: Difference between revisions
m
Simplified code
m (→Python :: Functional: Tidying) |
m (Simplified code) |
||
Line 124:
The output of this program is an SVG file depicting a Koch snowflake.
<lang cpp>// See https://en.wikipedia.org/wiki/Koch_snowflake
#include <fstream>
#include <iostream>
Line 146 ⟶ 145:
x1 = points[i + 1].x;
y1 = points[i + 1].y;
double
double
output[j].x = x0;
output[j].y = y0;
output[j + 1].x = x0 +
output[j + 1].y = y0 +
output[j + 2].x = x0 +
output[j + 2].y = y0 +
output[j + 3].x = x0 + 2 *
output[j + 3].y = y0 + 2 *
}
output[j].x = x1;
|