Is there a way in TikZ to reflect regular polygons of an arbitrary number of edges, along each edge-considered-as-mirror?
I'm using MacTeX, and I'm new to LaTeX, pgf and TikZ.
I'd like to do this to demonstrate a geometric construction that can be done using reflections, with polygons of an arbitrary number of edges.
For some polygons (e.g. triangles and hexagons), this can be iterated to generate a tessellation of the plane. (Others have asked about hexagonal tilings, etc.)
Ideally, I'd like to be able simply to reference an edge, generate a line coincident with it, and provide the line as an argument to a subroutine that can perform the reflection of the polygon along the line through that edge.
This reflection can be simulated by rotations and translations, but I'd like to avoid the translations altogether (and the translation distance computations in (x,y)
coordinates, or even in polar coordinates). This is to have the code also serve as a demonstration of the principles of construction, not just the graphics. For polygons of an odd number of edges n
, a rotation of 180/n
is needed before translation; for polygons of an even number of edges, such rotation is not needed.
I've tried referencing nodes of superposed constructions to re-center the effectively-reflected polygons, but my references didn't seem to work. I've also tried what I'd thought were planar coordinates (ordered pairs) based on a radial coordinate system, which I'd taken from an example, but they didn't work as expected in my code.
\documentclass
and the appropriate packages so that those trying to help don't have to recreate it. In this case you could at least provide the code to produce the original polygon.