Ambiguous Rings 1: Polygon Based

This demonstration explores "ambiguous rings".
These are three-dimensional composite space curves that can be viewed as either a circle, a polygon, a crown-like shape or an S-like shape, depending on the view direction.
Such a "ring" or "ring-set" can be defined as the intersection curve of a circular cylinder and a generalized cylinder over a regular polygon crossing at a right angle.
In this demonstration, we consider intersections of a circular cylinder and a cylinder over a regular polygon with 3, 4 ,5 or 6 vertices.
The specific settings for the radius and axial offset of the circular cylinder and the number of vertices and axial rotation of the polygon based cylinder can be adjusted with the controls.
For each case, closed curves are possible when there is an exact fit of the polygonal cylinder's cross section inside the circular cylinder. The two solutions for this (A and B) can be computed using the appropriate buttons.
A single ring with the same view properties (circle or polygon) can be generated using a "cut off angle () to control the range of the angular parameter in the parametric equation of the full ringset.

DETAILS

The parametric equation of a circular cylinder with radius inclined at an angle from the vertical is:
, with parameters and .
Define the functions:
and
The and functions define the composite curve of the -gonal base of the polygonal cylinder [1].
The parametric equation of a polygonal cylinder with sides and radius rotated by an angle around its axis is:
with parameters and .
To find the equation of the intersection curve, put . This gives the three equations:
,
,
.
With A=
These are 3 equations with four variables, , , , and . Eliminating , , and by solving the equations gives the parametric equation of the intersection curve with θ as the only parameter:
.
Reference
[1] E. Chicurel-Uziel, "Single Equation without Inequalities to Represent a Composite Curve," Computer Aided Geometric Design, 21(1), 2004 pp. 23–42.i:10.1016/j.cagd.2003.07.011.