Geogebra setup

Given the success of GeoGebra as a tool for geometric constructions, this is probably the more easily available way to insert a problem into Newclid. The main work you have to do if you decide to follow this path is to create a GeoGebra model of the problem. Then, Newclid will try to read the .ggb file generated by GeoGebra (roughly equivalent to GeoGebra’s “Algebra” list), and extract point coordinates and hypothesis from it.

Some things have to be taken into account when doing this:

  • Not all GeoGebra constructions are supported by Newclid. For example, the engine has no concept of general conic sections, will not recognize transforms, and still has no implementation of tools that prescribe measures. If those tools are used, the coordinates of the points involved will be added, but no predicates will be created.

  • Differently from GeoGebra, Newclid is entirely based on the points as arguments for predicates. This means that if a circle or a line is created with no point on it (or only one point, for that matter), Newclid will extract no information from it, as our predicates will not have enough arguments to be created.

  • Sometimes GeoGebra can create more points than explicited in the problem. For example if you intersect two circles but the problem considers only one intersection point. In that case, you can hide the extra points in GeoGebra and they will be completely ignored by Newclid.

  • Even if your diagram is precise, maybe the problem demands some conditions that are not explicitly created by the GeoGebra model (eqratio is the first example of a predicate that is not created by GeoGebra). In that case, you can add the needed predicates using the .with_extra_assumptions() method of the GeoGebra problem builder. Similarly, if you generated too many assumptions while trying to realize a construction on GeoGebra, you can remove them afterwards using the .without_assumptions() method.

  • You can, in fact it is recommended, use the pretty_print_problem() function on the NcProblem generated by the GeoGebra problem builder to see the assumptions and goals of the problem, and check if they are what you expect.

Finally, once you have your GeoGebra model ready, you have to add the goals of the problem by hand, as GeoGebra cannot provide them. To do that, you should use the .with_goals() method of the GeoGebra problem builder, passing a list of predicates that correspond to the goals of the problem.

To manipulate the assumptions or to add the goals of the problem you will need to get familiar with the predicates used by Newclid (see their list at Newclid Predicates), but those represent just a small vocabulary. Also, the easiest way to add an assumption or goal is as a string, but the methods of the builder only accept PredicateConstruction arguments, so you’ll typically have to use the PredicateConstruction.from_string() method to convert a string into a predicate.

We have a tutorial on how to use GeoGebra with Newclid - check the notebook geogebra_problem.ipynb.