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.
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)
height(A, B, C)
angle(u)
or angle(l)
or angle(s)
angle(u, v)
angle(A, B, C)
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)
Here are all the point valued functions, except transformations.
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)
Here are all the line valued functions, except transformations.
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)
bisector(s)
bisector(A, B, C)
altitude(A, B, C)
median(s)
Here are all the segment valued functions, except transformations.
segment(A, B)
segment(A, u)
segment(A, x, ang)
segment(cir, ang)
Here are all the circle valued functions, except transformations.
circle(A, B)
circle(A, B, C)
circle(A, x)
incircle(A, B, C)
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)
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).
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)
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:
A B C D E F hexagon(G, x, ang)
It defines an hexagon of center G, side length x and such as argument of segment [OA] equals ang.
An interactive assignment is the following command:
x interactive(y, z, [ x1 , x2 , ] str, flg)
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 assignments are:
A B intersection(l, cir)
A B intersection(cir1, cir2)
If the two object are tangent, the two variables will be set to the same point.
The purpose of general graphical commands is mainly to set some general parameters.
Here are all of them:
frame(x1, y1, x2, y2 [ , z])
eukleides
, the optional parameter set the unit length to z cm (default: 1). With xeukleides
, 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
eukleides
, sets color to str (it has to be a valid pstricks color). With xeukleides
, it has no effect.
tricks str
eukleides
, 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 xeukleides
, it has no effect.
font str
xeukleides
, changes current font. String str has to be a valid XLFD. With eukleides
, it has no effect.
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).
abscissa
: Points
abscissa
: Numbers
acos
: Numbers
altitude
: Lines
angle
: Numbers
asin
: Numbers
atan
: Numbers
barycenter
: Points
begin
: Points
bisector
: Lines
center
: Points
circle
: Circles
`-'
: Vectors
`-'
: Numbers
`/'
: Vectors
`/'
: Numbers
`^'
: Numbers
`*'
: Vectors
`*'
: Numbers
`+'
: Vectors
`+'
: Numbers
color
: Graphic
cos
: Numbers
deg
: Numbers
distance
: Numbers
draw
: Drawing
end
: Points
equilateral
: Triangles
font
: Graphic
frame
: Graphic
height
: Numbers
hexagon
: Polygons
homothecy
: Transformations
interactive
: Interactive
intersection
: Intersections
intersection
: Points
isosceles
: Triangles
length
: Numbers
line
: Lines
mark
: Drawing
median
: Lines
midpoint
: Points
ordinate
: Points
ordinate
: Numbers
orthocenter
: Points
parallel
: Lines
parallelogram
: Polygons
pentagon
: Polygons
perpendicular
: Lines
pi
: Numbers
point
: Points
projection
: Points
rad
: Numbers
radius
: Numbers
rectangle
: Polygons
reflection
: Transformations
right
: Triangles
rotation
: Transformations
rotation
: Vectors
segment
: Segments
sin
: Numbers
sqrt
: Numbers
square
: Polygons
tan
: Numbers
translation
: Transformations
triangle
: Triangles
tricks
: Graphic
vector
: Vectors