I found this question on another forum. Are there any hints how one could make pictures from geometric problems by coding? I mean, if one has a handicap in his hands and he can't use mouse very well, but he would like to learn to draw pictures like this and this by coding. What would be the easiest method to do such a pictures? Python? Some LaTeX package?
-
$\begingroup$ Turtle graphics AKA LOGO. $\endgroup$– user5402Jul 6, 2015 at 14:48
-
$\begingroup$ Relevant: math.stackexchange.com/q/128674/3787 $\endgroup$– HuyJul 7, 2015 at 11:06
-
$\begingroup$ Please see my answer here: matheducators.stackexchange.com/questions/10136/… $\endgroup$– AndrewMay 2, 2017 at 16:08
6 Answers
One possibility is to use GeoGebra. I use it for making any geometrical drawings I need, especially if I want to show them in public.
It can be used via text, too, but I've only used it via the graphic interface. One benefit is that even in text mode this is WYSIWYG so you don't have to compile to see what you'll get.
There are indeed several LaTeX packages available for this. I have only experience with one - TikZ. The best impression of what it can do is probably the corresponding Texample page. If you want to learn it, at least the introductory chapters of the manual coming along with the package are rather good. While looking them up I noticed that there's also a shorter introduction document in there now. I haven't worked with that one, but its content at least contains something about tangency, which is probably close to what you might be interested in.
There's also (at least) PSTricks - but I've never worked with that one. It seems to have more links to postscript, so I'm a bit sceptical of its use in general circumstances...
Back in school we have used the programming language Logo which comes along with a graphical toolkit (Turtle graphics). That should also work - but I haven't used it since school. Skimming over the wikipedia articles it seems to have a lot of different implementations, sometimes standalone from Logo, and sometimes with extensions for 3D graphics.
-
1$\begingroup$ I'm a fan of the tkz-euclide package for tikz. I've found it easier and intuitive to create geometric figures than using vanilla tikz. The only downside is that the documentation is in French, but the commands are English and it's not difficult to figure it out. $\endgroup$– michaelJul 8, 2015 at 18:21
-
$\begingroup$ Ha, for just an instant I believed you to be Wrath of Seth. $\endgroup$ Sep 23, 2016 at 5:19
GeoGebra seems nice, but for that figure you posted looks as if metapost is the tool of choice. What I don't like about GeoGebra is, that you need to login at least when I try to install the linux version and just start it.
TikZ
is nice, but for my taste it's better to build the figures apart from the document you want to include them.
There are many other tools for this. See the old troff resource for example. But the troff pic macros are better used for more simple diagrams and don't integrate that good with the LaTeX rendering process.
-
1$\begingroup$ I have used only the Windows version of Geogebra, but there is no login for that version. Also, the OP has two figures: for which one do you think metapost is better? $\endgroup$ Jul 6, 2015 at 10:43
-
$\begingroup$ I can't say much about GeoGebra, as I don't want to login. But metapost has ways to calculate the intersection points automatically. I think GeoGebra might have similar features, but I find it hard to see the text examples. Metapost is a very concise language to handle coordinates and basic geometric figures. AND: Learning about how Donald E. Knuth thinks about computer languages means learning from one of the best. AND if you installed LaTeX there is a good chance that you already have metapost. $\endgroup$– ikrabbeJul 6, 2015 at 10:48
For completeness, I suggest here two other graphics languages.
The first one is a powerful graphics language with a C++-like syntax named Asymptote. It can be easily interfaced with LaTeX and provide commands which are suitable to draw geometric figures (e.g. commands for finding intersections between curves).
However, it's not for the faint of heart, and the learning curve can be steep. Suggested to an experienced programmer.
The second is a much simpler graphics language developed by Brian Kernighan (in this paper you can find an introduction to it) called PIC. Dwight Aplevich developed a PIC interpreter called DPIC, which comes with a few extension to the original language.
PIC is not as powerful as Asymptote (e.g. it lacks of commands for finding intersections), but it has a much simpler syntax.
I second Geogebra. It's free, runs in a browser and quite slick. I haven't worked how to properly script with it yet, but there must be a way.
Also, Scratch can draw in a logo/turtle graphics style.
The tool GCLC by Predrag Janicic offer a textual language to describe geometric figures.
The tool can export to tikz and pstricks.
See: http://poincare.matf.bg.ac.rs/~janicic//gclc/
The language is described in the following paper: https://link.springer.com/article/10.1007/s10817-009-9135-8