# Translating a polygon into a fundamental domain

Hello.

I have a polygon (defined, say, via polygon()) that I'm thinking of as filled in with some color. I'd like to understand its image on the quotient of $\mathbb{R}^2$ mod $\mathbb{Z}^2$ by seeing this image in a fundamental domain like the unit square with corners (0,0), (1,0), (0,1), (1,1).

Put differently, I want to translate (by a lattice point) each point in and on the polygon into this square and see what the result looks like.

Is there a reasonable way to do this in SAGE?

edit retag close merge delete

Sort by » oldest newest most voted

Hi,

polygon is just a function for plotting. In order to be able to solve your problem you should use Polyhedron as in

sage: P = Polyhedron(vertices=[(0,0),(1.3,2.2),(0.7,1)])
sage: P.plot() Then you compute a bounding box for your polyhderon

sage: xmin = min(x for x,y in P.vertices_list())
sage: xmax = max(x for x,y in P.vertices_list())
sage: ymin = min(y for x,y in P.vertices_list())
sage: ymax = max(y for x,y in P.vertices_list())


And for each square fundamental domain within your bounding box you compute the intersection of P with the square and store the translates:

sage: L = []
sage: for i in xrange(xmin,xmax+1):
...     for j in xrange(ymin,ymax+1):
...       K = P.intersection(Polyhedron(vertices=[(i,j),(i+1,j),(i+1,j+1),(i,j+1)]))
...       if K.dim() == 2:
...         L.append(K.translation((-i,-j)))


Then you can plot each pieces into a fundamental domain:

sage: n = len(L)
sage: colors = rainbow(n,'rgbtuple')
sage: sum((L[i].plot(color=colors[i]) for i in xrange(n)), Graphics()) Vincent

more