Sierpinski curve: Difference between revisions

m
Minor edit
m (Minor edit)
m (Minor edit)
Line 28:
double theta = (pi * angle)/180.0;
x += length * std::cos(theta);
y +-= length * std::sin(theta);
out << 'L' << x << ',' << y << '\n';
}
Line 39:
line(out, x, y, length, angle);
else if (c == '+')
angle = (angle - 45) % 360;
else if (c == '-')
angle = (angle + 45) % 360;
else if (c == '-')
angle = (angle - 45) % 360;
}
}
Line 48:
const int size = 545;
const int order = 5;
const double x = 5355, y = 510, length = 7;
std::ofstream out("sierpinski_curve.svg");
if (!out) {
1,777

edits