Generating Jordan, 5
There is a Jordan curve such that every piecewise-linear path from the inside to the outside intersects the curve infinitely many times. I define the wiggling precisely here in terms of courses (turn-type sequences).
Local wiggling to triples
Last time I described the local picture of a wiggled hex curve. That is, given a hex curve and a triangle with a turn of I described what looks like, and gave a picture of this. Our task now is to draw a hex curve wiggled several times.
Our preferred representation of a hex curve is its course, i.e. its sequence of turn-types. The local picture in a triangle always wiggles to three oriented components, yielding three courses. We want to specify triples of courses of the sort one gets by taking the courses of such unions of oriented components in a sequence of consecutively adjacent triangles.
More specifically, let us say an (intermediate) triple is a triple of courses such that for some triangles and (possibly the same), + beginning at ends at + beginning at ends at and + beginning at ends at Fixing and a bend in determines
In the previous post we worked out what these triples were for when contained a port turn. As in that post, we label the components of variously and Recall that
- starts from with course and thus ends at
- starts from with course and thus ends at and finally,
- starts from with course and thus ends at
We express this in Python as follows:
= ("PSPSSSSPSPS","PSPSPSPPSPS","PSPSSPSPSPSPPPPSPSPSPSPPSPS") P_becomes
Suppose we follow that port turn in a triangle with a starboard turn in another triangle For the starboard turn in we get the following, mutatis mutandis:
- starts from with course and thus ends at
- starts from with course and thus ends at and finally,
- starts from with course and thus ends at
(The ordering of triangles along the given sides of are also from port to starboard.) We can express this likewise in Python as follows:
= ("PSPSSPSPSPSPSSSSPSPSPSPPSPS","PSPSSPSPSPS","PSPSPPPPSPS") S_becomes
(The reader may check that if is the former triple shown and the latter, then these triples are related by where the function reverses each string in the triple, swaps with and vice versa, and reverses the triple, as in the following code.)
def flip(trp):
= list(trp)
lst = [list(reversed(path)) for path in lst]
lst = lambda tok: "P" if tok == "S" else "S"
swap = [[swap(tok) for tok in path] for path in lst]
lst return tuple(reversed(lst))
Thus the following statements hold: + intersects no components of + intersects no components of + ends at + begins at and ends at + begins at and ends at and finally, + begins at
Joining triples
The union of all these components in the union therefore again has three oriented components. Two components have not been fitted together with others. The first is the component of The latter is the component of Finally, the middle component is composed of the four other components. Considering the components as oriented arcs, and labelling them in and in in that order, we have that is also the union of three oriented components, to wit in that order.
The same incidence relations hold, with different courses, when following port with port, starboard with port, or starboard with starboard. Port to starboard and starboard to starboard are depicted in the following figure.

Thus, if and are two intermediate triples, we define their join to be
def join(trp0, trp1):
= trp0
(m, y, c) = trp1
(mp,yp,cp) return (m, y+mp+c+yp, cp)
Wiggling a course
Let Let be the set of courses. Following the above, we define the function as follows:
so that Then, given a course (with ), we define (This is well-defined since is associative.)
With this definition we have almost determined the course of given the course of The above gives us that is the union of three hex curves whose three courses are those in the triple It remains to determine how to join these courses. Now, is a triple beginning in some triangle and ending in some triangle Assuming is the course of a closed hex curve, likewise is too. Thus the aft side of and the fore side of coincide. So and coincide along these sides for Now, ends at and begins at ends at and begins at and finally ends at and begins at Thus the complete course of is
def wiggle(tokens):
= map(lambda tok: P_becomes if tok == 'P' else S_becomes, tokens)
trps = trps.__next__()
tot for trp in trps:
= join(tot,trp)
tot = tot
(MM,YY,CC) return YY + MM + CC