[Top] | [Contents] | [Index] |
EUKLIDES
Euklides is an euclidean geometry drawing language. The compiler euklides
allows you to typeset geometry figures within a
(La)TeX document. The X-Window program xeuklides
makes possible to create interactive geometry figures.
This is version 1.3 of Euklides documentation.
Overview of the Euklides system An overview of the Euklides system 1. Design of the language The design of the language 2. Handling numbers and number valued functions 3. Handling vectors 4. Point valued functions 5. Line valued functions 6. Segment valued functions 7. Circle valued functions 8. Geometrical transformation functions 9. Defining triangles 10. Defining polygons 11. Intersection points Determining intersection points 12. Interactive assignements Defining interactive variables 13. General graphical commands 14. Drawing commands 15. Samples Some source files of classical figures Contact Bug reports and comments Concept index Index of concepts Command index Index of commands
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The language Euklides provides simple and powerfull commands for creating elementary euclidean geometry figures.
The underlying philosophy is to avoid as much as possible the use of coordinates.
The compiler euklides
translates a source file written in this specific language into TeX (pstricks
) macrocommands.
(The result is sent to standard output.)
The X-Window program xeuklides
is a complete system for editing and viewing figures described in this language. With xeuklides
,
the figures can be interactive, i.e., while viewing, it is possible to modify some numerical values using the keyboard.
There are three situations where Euklides can be usefull:
euk2eps
on a Euklides source file.
%--euklides
at begin and %--end
or %--stop
at end. The %--stop
ending tag tells euklides
to keep variables in memory for further use. With the %--end
tag,
variables are cleared. If you run euklides
with the -f
option on the source file, the Euklides commands are replaced with
pstricks
commands and you obtain a ready-to-tex file. (Don't forget to load the pstricks
package.)
xeuklides
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An Euklides source file can contain:
A variable name is a letter, possibly followed by any letter or digit. Warning: Euklides 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 assignement 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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To compute usual arithmetic operations, use the symbols : `(', `)', `+', `-', `*', `/', `^' (for exponentiation).
Here are all the number valued functions:
sqrt(x)
pi
sin(x)
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
deg(x)
rad(x)
abscissa(A)
or abscissa(u)
ordinate(A)
or ordinate(u)
distance(A, B)
or distance(A, l)
length(u)
or length(s)
radius(cir)
heigth(A, B, C)
angle(u)
or angle(l)
or angle(s)
angle(u, v)
angle(A, B, C)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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:
vector(x, y)
vector(x, ang)
vector(A, B)
vector(l)
vector(s)
rotation(u, ang)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here are all the point valued functions, except See section 8. Geometrical transformation functions.
point(x, y)
point(x, ang)
point(l, x)
point(s, x)
point(cir, ang)
projection(A, l1 [, l2])
barycenter(A [, x], B [, y])
intersection(l1, l2)
abscissa(l, x)
ordinate(l, y)
midpoint(s)
begin(s)
end(s)
center(cir)
orthocenter(A, B, C)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here are all the line valued functions, except See section 8. Geometrical transformation functions.
line(A, B)
line(A, u)
line(s)
line(A, ang)
line(cir, ang)
parallel(l, A)
or parallel(s, A)
perpendicular(l, A)
or perpendicular(s, A)
bissector(s)
bissector(A, B, C)
altitude(A, B, C)
median(s)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here are all the segment valued functions, except See section 8. Geometrical transformation functions.
segment(A, B)
segment(A, u)
segment(A, x, ang)
segment(cir, ang)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here are all the circle valued functions, except See section 8. Geometrical transformation functions.
circle(A, B)
circle(A, B, C)
circle(A, x)
incircle(A, B, C)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
We'll note obj an object which can be a point, a line, a segment or a circle. Here are all the transformation functions:
translation(obj, u)
reflection(obj, l)
rotation(obj, A [, ang])
homothecy(obj, A, x)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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:
A B C triangle[(x [ , ang])]
A B C triangle(x, y, z [ , ang])
A B C triangle(x, ang1, ang2 [ , ang3])]
A B C right[(x, y [ , ang])]
A B C right(x, ang1 [ , ang2])
A B C isosceles[(x, ang1 [ , ang2])]
A B C isosceles(x, y [ , ang])
A B C equilateral[(x [ , ang])]
Note: The last optional parameter is the argument of segment [AB] (default: 0 degrees).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
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:
A B C D parallelogram[(x, y, ang1 [ , ang2])]
A B C D parallelogram(u, v [ , ang])
A B C D rectangle[(x, y [ , ang])]
A B C D square[(x [ , ang])]
Note: The last optional parameter is the argument of segment [AB] (default: 0 degrees).
A pentagon assignment is the following command:
A B C D E pentagon(F, x, ang)
An hexagon assignment is the following command:
A B C D E hexagon(G, x, ang)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A B intersection(l, cir)
A B intersection(cir1, cir2)
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
x interactive(y, z, [ x1 , x2 , ] str, flg)
euklides
, variable x is simply set to number y.xeuklides
, 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).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The purpose of general graphical commands is mainly to set some general parameters.
Here are all of them:
frame(x1, y1, x2, y2 [ , z])
euklides
, the optional parameter set the unit length to z cm (default: 1). With xeuklides
, this parameter
has no effect, because the figure is always drawn using the largest scale such that it fits into the drawing area. If no frame is specified
it is set to default frame: (-2, -2, 8, 6).
color(flg)
color str
euklides
, sets color to str (it has to be a valid pstricks color). With xeuklides
, it has no effect.
tricks str
euklides
, adds an initial `\' to str and puts it verbatim to the output. It has to be valid TeX code. You can use it to
define your own colors, draw a curve, etc. With xeuklides
, it has no effect.
font str
xeuklides
, changes current font. String str has to be a valid XLFD. With euklides
, it has no effect.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here are all the drawing commands.
draw(A [ , flg])
dot
, box
, cross
and plus
(default: dot).
draw(u, A [ , flg])
full
,
dashed
and dotted
(default: full).
draw(l [ , flg1 [ , flg2]])
full
,
dashed
and dotted
(default: full). Permitted values of flg2 are entire
, halfline
and backhalfline
(default: entire).
draw(s [ , flg1 [ , flg2]])
full
,
dashed
and dotted
(default: full). Permitted values of flg2 are noarrow
, arrow
, backarrow
and
doublearrow
(default: noarrow).
draw(cir [ , flg])
full
, dashed
and
dotted
(default: full).
draw(cir, ang1, ang2, [ , flg1 [ , flg2]])
full
, dashed
and dotted
(default: full). Permitted
values of flg2 are noarrow
, arrow
, backarrow
and doublearrow
(default: noarrow).
draw(A, B, C, [ , flg])
full
, dashed
and dotted
(default: full).
draw(A, B, C, D [ , flg])
full
, dashed
and
dotted
(default: full).
draw(A, B, C, D, E, [ , flg])
full
, dashed
and dotted
(default: full).
draw(A, B, C, D, E, F [ , flg])
full
, dashed
and dotted
(default: full).
draw(str, A, [ x, ] ang)
draw(str, s, [ x, ] ang)
draw(x, [str, ] A, [ y, ] ang)
draw(x, [str, ] s, [ y, ] ang)
draw(x1, x2, str, A, [ y, ] ang)
draw(x1, x2, str, s, [ y, ] ang)
mark(s [ , flg])
simple
, double
,
triple
and cross
(default: simple).
mark(A, B, C [ , flg])
simple
, double
,
triple
, dash
, arrow
, backarrow
and right
(default: simple).
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
An isosceles triangle with some of its elementary properties illustrated.
A B C isosceles ; draw(A, B, C) H = projection(C, line(A, B)) ; draw(segment(C, H), dashed) ; mark(B, H, C, right) mark(segment(A, C), cross) ; mark(segment(C, B), cross) mark(B, A, C, dash) ; mark(C, B, A, dash) |
A figure illustrating a property of the incircle in a triangle.
A B C triangle ; draw(A, B, C) ; draw(incircle(A, B, C)) draw(bissector(B, A, C), dotted) draw(bissector(A, B, C), dotted) draw(bissector(B, C, A), dotted) |
Addition of two vectors.
A B C D parallelogram draw(segment(A, B), full, arrow) ; draw(segment(A, C), full, arrow) ; draw(segment(A, D), full, arrow) draw(segment(B, C), dotted) ; draw(segment(D, C), dotted) |
An angle property of parallelograms.
A B C D parallelogram(5, 4, 105:) ; draw(A, B, C, D) mark(B, A, D) ; mark(D, C, B) mark(C, B, A, double) ; mark(A, D, C, double) |
An hexagon and its diagonals.
A B C D E F hexagon(point(3,2), 3, 0:) ; draw(A, B, C, D, E, F) draw(segment(A, D), dotted) draw(segment(B, E), dotted) draw(segment(C, F), dotted) |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Euklides has been created by Christian Obrecht.
Please send bug reports and comments at obrecht@mail.chez.com.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | %
A C D E F G H I L M N P Q R S T V |
---|
Jump to: | %
A C D E F G H I L M N P Q R S T V |
---|
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Jump to: | `
A B C D E F H I L M O P R S T V |
---|
Jump to: | `
A B C D E F H I L M O P R S T V |
---|
[Top] | [Contents] | [Index] | [ ? ] |
Overview of the Euklides system
1. Design of the language
2. Handling numbers and number valued functions
3. Handling vectors
4. Point valued functions
5. Line valued functions
6. Segment valued functions
7. Circle valued functions
8. Geometrical transformation functions
9. Defining triangles
10. Defining polygons
11. Intersection points
12. Interactive assignements
13. General graphical commands
14. Drawing commands
15. Samples
Contact
Concept index
Command index
[Top] | [Contents] | [Index] | [ ? ] |
Overview of the Euklides system
1. Design of the language
2. Handling numbers and number valued functions
3. Handling vectors
4. Point valued functions
5. Line valued functions
6. Segment valued functions
7. Circle valued functions
8. Geometrical transformation functions
9. Defining triangles
10. Defining polygons
11. Intersection points
12. Interactive assignements
13. General graphical commands
14. Drawing commands
15. Samples
Contact
Concept index
Command index
[Top] | [Contents] | [Index] | [ ? ] |
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | previous or up-and-previous section | 1.1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next or up-and-next section | 1.3 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | concept index | |
[ ? ] | About | this page |