We think that most readers of this papers are neither technicians, nor mathematicians, but teachers. Nevertheless, it is good to know some computational details how the [b]LocusEquation[/b] command works.[br][br]Computing a locus equation can be time consuming even for fast computers. Basically, a set of equations has to be created in the background: the more objects we have in our construction, the more variables and equations we need. After setting up algebraic equations, they have to be solved symbolically in an efficient way. For this task we use Gröbner bases.[br][br]GeoGebra uses the Giac computer algebra system to compute Gröbner bases as efficiently as possible, but the general method is still double exponentional in the number of variables. On the other hand, Giac runs in a web browser in today's computers, and this slows down computations by almost one magnitude. (This means that computing locus equation in the desktop version of GeoGebra is still much faster than observing the construction in a web browser. For the future, however, there are plans to speed up JavaScript computations by substituting them with native instructions.)[br][br]Giac is a powerful CAS, but it can slow down if bogus input must be processed. That is why it is desired to solve equations only having integer coefficients. To achieve this, it is suggested to use so-called dynamic coordinates in GeoGebra: to create free point [color=#0000ff]A'[/color], [color=blue]B'[/color], [color=blue]C'[/color] ... first and then define point [b]A=DynamicCoordinates[[color=blue]A'[/color],round(x([color=blue]A'[/color])),round(y([color=blue]A'[/color]))][/b], then similar definitions for points B and C and so on.[br][br]Also using "easy" coordinates will speed up computations. For example, putting A into the origin, B on the x-axis and using small integers instead of larger numbers may decrease computation time significantly.
Since the Gröbner basis computation assumes algebraic (polynomial) equations, there are restrictions for the available construction steps for the [b]LocusEquation[/b] command. First of all, only Euclidean construction steps are supported. Even if a step could be converted into a Euclidean construction, some non-trivial way of wording are not supported, for example, when the user defines a parabola by entering its explicit formula, then it cannot be discovered by the [b]LocusEquation[/b] command at the moment. Instead, the parabola must be constructed by using the appropriate GeoGebra tool.[br][br]Most Euclidean two dimensional construction steps are already supported. To see the full list please refer to the Javadoc at [url=http://dev.geogebra.org/trac/wiki]the GeoGebra Developer Wiki[/url].[br][br]If a geometry problem is described fully or partially by formulas, it may be difficult to translate it to a purely Euclidean construction. Below we will see an example how this can be achieved.
Here we provide two examples to implement [url=http://en.wikipedia.org/wiki/Witch_of_Agnesi]Agnesi's witch[/url] in GeoGebra. The first approach will be a general way which will result in slow computation and some extra components. The second approach will be much faster and results only in one extra component.[br][br]For the first approach we simply consider the formula [math]y=\frac{1}{x^2+1}[/math]. Here we need to define the unit (1) and compute the square of x based on this unit, then add these two lengths. Then we need to compute the reciprocal of the result, and translate the final length y to the correct position of the coordinate system.
In this figure we can see a numerical locus in red and a symbolical locus in blue. In fact Agnesi's curve is just a part of these curves since the conversion of its formula will introduce extra components. Let us follow the steps we made in this figure:[br][br][list=1][*]Point [color=#0000ff]A[/color] is created (origin).[/*][*]Point [color=#0000ff]B[/color] is created, (0,1).[/*][*]Line a is the y-axis.[/*][*]Line b is the x-axis.[/*][*]Point [color=#7d7dff]C[/color] lies on the x-axis, it will be the projection of a point of the curve to the x-axis, i.e. its abscissa will be x.[/*][*]We will use the [url=http://en.wikipedia.org/wiki/Intercept_theorem]intercept theorem[/url] to construct [math]x^2[/math]. So we create a triangle with sides having length 1 ([color=#0000ff]AB[/color]) and x ([color=#0000ff]A[/color][color=#7d7dff]C[/color]). This triangle will be right, but this property is not necessary. The third side of the triangle will be line c.[/*][*]For the intercept theorem we prepare length x also on line [color=blue]AB[/color] by drawing circle d.[/*][*]Point D is intersection of line a and circle d. (In fact there are two intersection points here, but we use the "upper" one.) Now [math][color=blue]A[/color]D=x[/math].[/*][*]Line e is parallel to D and lies on D.[/*][*]Point E is intersection of line b and d. By using the intercept theorem obviously [math][color=blue]A[/color]E=x^2[/math].[/*][*]We are preparing addition, thus we draw another circle f around the origin having unit radius.[/*][*]Point F is intersection of line b and circle f. (In fact there are two intersection points here, but we use the "left" one.) Now [math]EF=x^2+1[/math].[/*][*]We would like to copy the unit length, so we create segment g as the unit (i.e., AB).[/*][*]Circle h is around point E with unit radius.[/*][*]Line i is perpendicular to line b and lies on point E.[/*][*]Point G is intersection of line i and circle h. (In fact there are two intersection points here, but we use the "upper" one.) Now GE is a copy of the unit. This is a preparation for applying another intercept theorem.[/*][*]We will use triangle EFG for the intercept theorem, thus we draw line FG as line j.[/*][*]Point H is again an intersection of circle h and line b. (The "left" one.) Now we copied the unit as EH, too.[/*][*]Drawing line k as a parallel one with line j through H.[/*][*]Intersection of lines i and k is point I.[/*][*]Now applying the intercept theorem for length IE we obtain [math]IE=\frac{1}{x^2+1}[/math]. This will be y.[/*][*]Now we will copy this length to point [color=#7d7dff]C[/color] orthogonally. Thus we draw a perpendicular with line b through [color=#7d7dff]C[/color]. This will be line m.[/*][*]We copy length IE to point [color=#7d7dff]C[/color] upwards, thus we draw circle p around [color=#7d7dff]C[/color] with radius IE.[/*][*]"Upper" intersection point of m and p will be point J.[/*][*]Locus of point J while [color=#7d7dff]C[/color] is moving on the x-axis is what we search for. In fact, only those points J are proper which have positive abscissa.[/*][*]Finally, [b]LocusEquation[/b] shows a 12 degree polynomial, [math]x^8y^4-2x^4y^4-2x^4y^2+y^4-2y^2+1[/math], which is a product of the cubic Agnesi curve and its reflection to the x-axis, and two other cubics (reflections of each other), namely [math]x^2y-y-1[/math], [math]x^2y-y+1[/math], [math]x^2y+y-1[/math] and [math]x^2y+y+1[/math].[/*][/list][br]After finishing this construction it is clear that we almost surely obtain extra components since it is impossible to exclude the "right" intersection point in steps 12 and 18, for example. The construction process described above illustrates the weakness of the Euclidean (i.e. in fact algebraic) method.
Finally we refer to a more simple definition of Agnesi's curve, also used by a Google "doodle" on the 296th anniversary of Maria Agnesi's birth on 16 May 2014.
This "easy" definition allows GeoGebra to show Agnesi's witch much faster than above and make it computationally possible to drag the input points even in a web browser. Of course, in many cases such a simplification is an intellectual challenge by searching for algebraic or geometric simplifications to result in less variables in the Gröbner basis computations.
As an exercise, we leave to the Reader to prove that the trace of point [color=#ff0000]F[/color] is [math]y=\frac{1}{x^2+1}[/math] if [color=#0000ff]B[/color] is in the origin, [color=#0000ff]A[/color]=(0,1/2) and [color=#7d7dff]C[/color]=(0,1). Also an exercise in GeoGebra to improve this figure: use [b]DynamicCoordinates[/b] instead of point capturing to grid points (which yields non-continuous motion for point [color=#7d7dff]D[/color]). Another improvement can be to put the equation text into a fix position, preferably in the second Graphics View.