Language description

Design of the language

An Eukleides source file can contain:

A variable name is a letter, possibly followed by any letter or digit. Warning: Eukleides is case sensitive. An expression can have several type of values : number, vector, line, segment, circle. A line of the source file can contain a unique assignment or command. It can also contain several ones, in this case they must be separed by semicolons. (No semicolon at the end of the line.)

We'll use the following notations (possibly followed by a digit) to describe the possible types of the parameters in a command:

An angle measure is a number expression followed by `:' (degrees) or `<' (radians). A string is any text contained in one line and enclosed in double quotes.

We'll use square brackets to indicate optional parameters.

Handling numbers and number valued functions

To compute usual arithmetic operations, use the symbols : `(', `)', `+', `-', `*', `/', `^' (for exponentiation).

Here are all the number valued functions:

Handling vectors

To compute usual vector operations, use the symbols : `(', `)', `+', `-', `*' (multiply by a number), `/' (divide by a number). To compute the scalar product of two vectors, use the symbol : `*'.

Here are all the vector valued functions:

Point valued functions

Here are all the point valued functions, except transformations.

Line valued functions

Here are all the line valued functions, except transformations.

Segment valued functions

Here are all the segment valued functions, except transformations.

Circle valued functions

Here are all the circle valued functions, except transformations.

Geometrical transformation functions

We'll note obj an object which can be a point, a line, a segment or a circle.

Here are all the transformation functions:

Defining triangles

A triangle assignment is a list of 3 variable names followed by the word triangle, right, isosceles or equilateral and some optional parameters. If the first variable is already defined as a point, the triangle will be constructed from this point. If not, the point will be set to origin.

Here are all the ways to define a triangle:

Note: The last optional parameter is the argument of segment [AB] (default: 0 degrees).

Defining polygons

A quadrilateral assignment is a list of 4 variable names followed by the word parallelogram, rectangle or square and some optional parameters. If the first variable is already defined as a point, the quadrilateral will be constructed from this point. If not, the point will be set to origin.

Here are all the ways to define a quadrilateral:

Note: The last optional parameter is the argument of segment [AB] (default: 0 degrees).

A pentagon assignment is the following command:

It defines a pentagon of center F, radius x and such as argument of segment [OA] equals ang.

An hexagon assignment is the following command:

It defines an hexagon of center G, side length x and such as argument of segment [OA] equals ang.

Interactive assignments

An interactive assignment is the following command:

With eukleides, variable x is simply set to number y.
With xeukleides, it allows, while viewing, to modify the value of the numerical variable x using the arrow keys. The initial value of x is y, the increment is z. The optional parameters x1 and x2 are the lower and upper bound of x. The string str has to contain one uppercase letter. To modify x, one has to press first the corresponding key (at the beginning, the default state is `A'). The permitted values of flg are right (in this case, x will be incremented by pressing the right arrow key and decremented by pressing the left arrow key) or up (in this case, x will be incremented by pressing the up arrow key and decremented by pressing the down arrow key).

Intersection points

Intersection assignments are:

If the two object are tangent, the two variables will be set to the same point.

General graphical commands

The purpose of general graphical commands is mainly to set some general parameters.

Here are all of them:

Drawing commands

Here are all the drawing commands.

Concept index

Command index