Introduction
GeoGebra is based on two elements: GeoElement (from now on, geos) and AlgoElement (from now on, algos).
Oddly enough, I am really interested on algos. I consider two types of algos: contruction algos and restriction algos.
What does this mean?
Almost all geos have a non-null ParentAlgorithm, and that algo is a construction algo (AlgoConicFivePoints, AlgoJoinPointsSegment, etc). However, geos also have an AlgorithmList, which has restriction algorithms. For example, a point on a geo has AlgoPointOnPath, and I considered AlgoPointOnPath a restriction algorithm because it does not "tell" where the point is from, but that the point is "bounded" somehow.
Why do you treat them differently?
A construction algo is used for constructing an EquationElement, and that EquationElement is used to get the equations in the restriction algos. These ideas may seem confusing at first sight, but they are quite simple. Take a look at the following example:
With five free points you can build a conic. This conic is built by AlgoConicFivePoints, so I build an EquationConicFivePoints (to make a consistent nomenclature, AlgoX construction algo become EquationX equation elements). Now, if you put five points on the conic, those geos will have an AlgoPointOnPath as parent algorithm. Therefore, I build an EquationPointOnPathRestriction (AlgoX restriction algos become AlgoXRestriction). Inside this object, the original algo is used to retrieve the conic in order to retrieve the EquationConicFivePoints through the scope (I've called scope because it is like the store variables). Finally, I used the retrieved equation element and the point to generate a restriction, i.e. a equation list.
Why is the difference so important? The case of the midpoint. =
For a long of time, I thought that midpoint algos were constructing algos. This only led to problem after problem. Once I decided that they should be actually restriction algos, everything nice, as Mathematics should be; even in some sense, symmetrical, since then there were an empty intersection between construction and restriction algos.
