DrGeo
Encyclopedia
DrGeo is a free software, created by Hilaire Fernandes for the Ofset. As its names suggests, it is a geometry software. It runs over GTK+
interface.
There is also the intersection
of 2 curves and the midpoint
of a segment
.
, ray, segment
and vector.
There are also the circle (defined by 2 points) but also the less classic arc by three points. DrGeo can also construct polygons (given by points) and loci
.
creates a numeric object, whose value is the square of the first number. If now the first number is changed, the second one changes too.
If now one wants to implement the square of a complex number, one has to create 2 numeric values, one for the real part, and the other one for the imaginary part. As , the script for the real part is (once one has selected a free point)
and the script for the imaginary part (with the same point selected):
getCoordinates a1 yields a list because a1 is a point, which has 2 coordinates. The CAR
of this list is the first coordinate, which is the abscissa
, and the CADR
of the list (the CAR
of the CDR
) is the second coordinate.
Once this is done, it remains only to create a point which coordinates are the two numbers created by scripts, and a transformation is defined; it implements the function and can be transformed into a macro.
object can only create one number, then if one wants to create a complex figure by a script, one has to write the script with a text editor, save it with the scm file extension, then make DrGeo evaluate the file.
Here is how DrGeo can create a Sierpinski triangle
recursively:
GTK+
GTK+ is a cross-platform widget toolkit for creating graphical user interfaces. It is licensed under the terms of the GNU LGPL, allowing both free and proprietary software to use it. It is one of the most popular toolkits for the X Window System, along with Qt.The name GTK+ originates from GTK;...
interface.
Points
DrGeo has two kinds of points: A free one, which can be moved with the mouse (but may be attached to a curve), and a point given by its coordinates.There is also the intersection
Line-line intersection
In Euclidean geometry, the intersection of a line and a line can be the empty set,a point, ora line. Distinguishing these cases, and finding the intersection point have use, for example, in computer graphics, motion planning, and collision detection....
of 2 curves and the midpoint
Midpoint
The midpoint is the middle point of a line segment. It is equidistant from both endpoints.-Formulas:...
of a segment
Line segment
In geometry, a line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points. Examples of line segments include the sides of a triangle or square. More generally, when the end points are both vertices of a polygon, the line segment...
.
Lines
DrGeo is equipped with the classic lineLine (geometry)
The notion of line or straight line was introduced by the ancient mathematicians to represent straight objects with negligible width and depth. Lines are an idealization of such objects...
, ray, segment
Line segment
In geometry, a line segment is a part of a line that is bounded by two end points, and contains every point on the line between its end points. Examples of line segments include the sides of a triangle or square. More generally, when the end points are both vertices of a polygon, the line segment...
and vector.
There are also the circle (defined by 2 points) but also the less classic arc by three points. DrGeo can also construct polygons (given by points) and loci
Locus (mathematics)
In geometry, a locus is a collection of points which share a property. For example a circle may be defined as the locus of points in a plane at a fixed distance from a given point....
.
Transformations
Besides the parallel and perpendicular line through a point, DrGeo can apply to a point one of these transformations:- reflexion
- symmetry
- translation
- rotation
- homothety
Macros
When some objects, called final depend from other objects, called initial it is possible to create a new transformation sending the initial objects to the final ones. This is a macro. It allows to add new objects to DrGeo like regular polygons or new transformations like circle inversion.Scripting
DrGeo comes up with a script language, which is Scheme (a Lisp-like language).Scheme object
It is possible also to create a Guile object, which is a number, but created with a script, written in the Scheme syntax. It can have one or several variables, which are chosen at the creation of the object, with mouse clicks. The names of the variables are a1, a2 etc. For example, if one wants the square of a number a1, the scriptcreates a numeric object, whose value is the square of the first number. If now the first number is changed, the second one changes too.
If now one wants to implement the square of a complex number, one has to create 2 numeric values, one for the real part, and the other one for the imaginary part. As , the script for the real part is (once one has selected a free point)
and the script for the imaginary part (with the same point selected):
getCoordinates a1 yields a list because a1 is a point, which has 2 coordinates. The CAR
Car and cdr
car and cdr are primitive operations on cons cells introduced in the Lisp programming language. A cons cell is composed of two pointers; the car operation extracts the first pointer, and the cdr operation extracts the second.Thus, the expression evaluates to x, and evaluates to...
of this list is the first coordinate, which is the abscissa
Abscissa
In mathematics, abscissa refers to that element of an ordered pair which is plotted on the horizontal axis of a two-dimensional Cartesian coordinate system, as opposed to the ordinate...
, and the CADR
Car and cdr
car and cdr are primitive operations on cons cells introduced in the Lisp programming language. A cons cell is composed of two pointers; the car operation extracts the first pointer, and the cdr operation extracts the second.Thus, the expression evaluates to x, and evaluates to...
of the list (the CAR
Car and cdr
car and cdr are primitive operations on cons cells introduced in the Lisp programming language. A cons cell is composed of two pointers; the car operation extracts the first pointer, and the cdr operation extracts the second.Thus, the expression evaluates to x, and evaluates to...
of the CDR
Car and cdr
car and cdr are primitive operations on cons cells introduced in the Lisp programming language. A cons cell is composed of two pointers; the car operation extracts the first pointer, and the cdr operation extracts the second.Thus, the expression evaluates to x, and evaluates to...
) is the second coordinate.
Once this is done, it remains only to create a point which coordinates are the two numbers created by scripts, and a transformation is defined; it implements the function and can be transformed into a macro.
Scheme-generated figure
The GuileGNU Guile
GNU Guile is an interpreter/virtual machine for the Scheme programming language. It was first released in 1993. Guile includes modularized extensions for POSIX system calls, APL array functionality, and others packaged as an object library...
object can only create one number, then if one wants to create a complex figure by a script, one has to write the script with a text editor, save it with the scm file extension, then make DrGeo evaluate the file.
Here is how DrGeo can create a Sierpinski triangle
Sierpinski triangle
The Sierpinski triangle , also called the Sierpinski gasket or the Sierpinski Sieve, is a fractal and attractive fixed set named after the Polish mathematician Wacław Sierpiński who described it in 1915. However, similar patterns appear already in the 13th-century Cosmati mosaics in the cathedral...
recursively: