#### Theory

###### Jürgen Richter-Gebert

We begin with the writing, and personal remarks/advice of the author of Cinderella, probably the theoretically most sound 2D dynamic geometry program.

His monograph on the topic is _Realization Spaces of Polytopes_. The main result is the Universality Theorem for 4-Polytopes, which basically says that the realization space of a 4-polytope can be an arbitrary algebraic set (as constrasted with the Steinitz Theorem that says that every polyhedron can be realized with rational coordinates).  The proof proceeds with a flavor similar to the proof of similar properties of the configuration spaces of linkages: he constructs polytopes which require that some measurement be the sum or product of some other measurements, etc.

He brings this result down a dimension to 3-diagrams, which are basically complexes of polyhedra -- in essence, Schlegel diagrams of polytopes. He has Corollary 10.4.1 on p.95, which says that, among other things, all algebraic numbers are needed to coordinatize all 3-diagrams, and that the realizability problem for 3-diagrams is NP-hard, being polynomial-time equivalent to the Existential Theory of the Reals. Other issues are that there are 3-diagrams for which the shape of some 2-face cannot be arbitrarily prescribed (again by contrast to the polyhedron case); the combinatorial types of realizable 3-diagrams cannot be characterized by a finite set of forbidden minors; and the maximum size of a 3 diagram with $n$ vertices under the constraint that coordinates be integers is bounded below by a doubly exponential function in $n$.

As a specific test case for a 3D dynamic geometry program, Jürgen suggests:

"a kinematic circle of six hinges. For almost all arrangements of of lengths and angles this will be a rigid body. But for some arrangements this will exhibit nice movements.
Here is a talk in German of me talking about those matters; a related Mechanism is at 7:00 [BR in der ARD Mediathek | ARD Mediathek](https://www.br.de/mediathek/video/campus-talks-prof-juergen-richter-gebert-av:5b4e7ccb00332600121858c5)"

Unfortunately, the link seems to be dead. However, I believe Jurgen was referring to mechanisms like kaleidocycles; see e.g. https://www.pnas.org/doi/10.1073/pnas.1809796115.

He also says the basic lesson of Cinderella was that to do the solving properly, it was critical to allow complex ambient spaces and allow solutions with complex coordinates (such as the imaginary intersection points of  two non-intersecting circles). This technique allowed, for example, intersection points (say of lines and circles) to vary continuously around configurations where they disappeared, by tracing a path among the complex solutions to link the real solutions, avoiding the singularity.

Jürgen also emphasized the need for an intuitive user interface. Notes on that will be in a separate file.

His final mathematical advice was reasonably encouraging, however:

"But still I would consider it all more or less doable. One should very precisely think about a doable scope.
I think three things are essential for the math no matter what you exactly plan.

1. Think projectively, 
   Use Projective Geometry, Homogeneous Coordinates (or to a certain extent Quaternions, and Clifford Algebras, which are more or less an elegant way to merge Complex numbers with projective concepts.)
2. Consider ambient complex spaces.
   The true nature of the objects can only be understood if embedded into a complex ambient space.
   More or less this is the lesson we learned from the Cinderella project.
3. Use clever and adequate mathematical representations
   So for 3D Geometry I would consider Plücker Coordinates as a good starting point,
   Some parts of which are covered by Clifford algebras. Clifford Algebras might make it difficult to embed everything in a proper complex ambient space, since they are already complex in nature by themselves."

###### Looking at CindyJS

It would be nice to see how Jürgen handled some of these issues in a 2D system that he designed. Unfortunately, Cinderella was and remains closed-source; it was distributed for profit for some stretch of time. However, (a part of?) it was reimplemented in JavaScript as CindyJS, which is open source. I took a relatively quick look at that source code at one point, and these were my observations:

CindyJS uses very concrete basic objects: 2D points are represented via projective geometry as a list of three floating-point numbers, and everything is done numerically.  There are no symbolic representations or exact algebraic numbers. (Not sure how a point on a circle or line is handled, that would take further investigation.) 

Lines are given by explicit coordinates as well (not sure of the internal details/exact coordinatization, or of how a "LineThrough" is represented).

Was unclear to me how the complex parametrization for preserving continuity was handled in the code, even though Jürgen harps on complex ambient spaces; where are the complex numbers? Perhaps that part of Cinderella was never re-implemented?


