Try Angle
a star that keeps falling into itself
Drag any corner. Click anywhere else to start over — it picks up a different pen each time.
In 2015 I had a project at 42 called fdf — draw a wireframe from a height map. I finished
it and then kept the window open for a month, drawing into it under one rule: a line was a
point, an angle and a length, never two coordinates, and the length had to come out of the
geometry of the line before it. The repo is still up, called triangle_try_angle, and one
of the functions is called draw_false_shit.
Three things came out of that month, and all three are in here.
The walk. Stand on a corner, drop a perpendicular onto the far side, stand where it
lands, drop another onto the next side. Each step is the altitude of the right triangle the
last one made — a * b / c, which was get_both() — so the walk keeps shortening. It
doesn’t shorten to nothing: after a dozen steps it falls into a triangle and stays there,
three more perpendiculars and you’re exactly where you started. That triangle is the heavy
one. All three corners fall into the same one.
The mirror. #define SYM(x) (x + ((e->xsym - x) * 2)). Reflect the whole thing and an
equilateral triangle and its reflection are a Star of David, which is what I remember
staring at. The reflected walk is drawn half a palette away from its twin, because the two
land almost on top of each other.
The bug. One function drew (x1, y) → (x, y1) instead of (x, y) → (x1, y1) — the ends
swapped. I lost a week to that. Swapping them leaves both ends on an axis and always the
same distance apart, so the whole family of lines wraps an astroid: the four-pointed weave
in the middle. It was never a bug.
Pens are the six colours out of misc.h, unchanged. RED was #A1124B and always was.