This is eukleides.info, produced by makeinfo version 4.0 from
eukleides.texi.

INFO-DIR-SECTION Mathematics
START-INFO-DIR-ENTRY
* Eukleides: (eukleides).	a Euclidean Geometry Drawing Language
END-INFO-DIR-ENTRY


File: eukleides.info,  Node: Top,  Up: (dir)

   EUKLEIDES

   Eukleides is a Euclidean geometry drawing language. Two softwares
are related to it. First, `eukleides', a compiler which allows to
typeset geometric figures within a (La)TeX document. This program is
also useful to convert such figures in EPS format or (using `pstoedit')
in various other vector graphic formats. Second, `xeukleides', an
X-Window front-end which makes possible to create interactive geometric
figures. This program is also useful to edit and tune some Eukleides
code.

   This is edition 2.1 of Eukleides' documentation.

* Menu:

* Tutorial::		A short tutorial to get started.
* Reference::		A comprehensive reference manual.
* Samples::		A set of source files illustrating various features.
* Contact::		Bug reports and comments.
* Concept index::	Index of concepts.
* Command index::	Index of commands.


File: eukleides.info,  Node: Tutorial,  Next: Reference,  Up: Top

Tutorial
********

   In this chapter, we'll see some possible usages of `eukleides', of
the shell scripts `euk2eps' and `euk2edit', and of `xeukleides'.

* Menu:

* Drawing a triangle::
* More about triangles::
* A property of parallelograms::
* The theorem of Thales::


File: eukleides.info,  Node: Drawing a triangle,  Next: More about triangles,  Up: Tutorial

Drawing a triangle
==================

   The language Eukleides has been designed in order to be close to the
traditionnal language of Euclidean geometry. For instance, to draw a
triangle, you just have to type:

     A B C triangle
     draw(A, B, C)

If you save these two lines in a file, say `triangle.euk', you can now
try this:

     $ eukleides triangle.euk

and you'll get the following output:

     % Generated by eukleides *.*.*
     \psset{linecolor=black, linewidth=.5pt, arrowsize=2pt 4}
     \psset{unit=1.0000cm}
     \pspicture*(-2.0000,-2.0000)(8.0000,6.0000)
     \pspolygon(0.0000,0.0000)(6.0000,0.0000)(2.2500,3.6742)
     \endpspicture

   The lines above are PSTricks commands, they can be inserted verbatim
in a (La)TeX source file (remember to first load the PSTricks package).

   The resulting document will contain a figure representing a scalene
triangle.

   To see this triangle there is a shorter way: the shell script
`euk2eps' generates a file in EPS format, which can be viewed with
GhostView.  Furthermore, the script `euk2edit' (which uses `pstoedit')
allows to convert the figure in a vector graphic format, like the ones
used for Xfig or Sketch. For instance, in order to edit the figure with
Sketch, type:

     $ euk2edit triangle.euk sk

   It is usually more convenient to have a single file containing both
text and illustrations. This is possible with `eukleides', using the
`-f' option and the special comments `%--eukleides' and `%--end'. For
instance, if you type the following lines with your favorite text
editor:

     \input pstricks
     This is a scalene triangle:\par
     %--eukleides
     A B C triangle
     draw(A, B, C)
     %--end
     \bye

and save this as `triangle.etex', you can get a DVI file with:

     $ eukleides -f triangle.etex > triangle.tex && tex triangle.tex

Then, you may convert this file in PostScript format and view it with:

     $ dvips -o triangle.ps triangle && gv triangle.ps


File: eukleides.info,  Node: More about triangles,  Next: A property of parallelograms,  Prev: Drawing a triangle,  Up: Tutorial

More about triangles
====================

   The X-window program `xeukleides' is a graphical front-end for the
language Eukleides. It has two modes: an editing mode and a viewing
mode. To start `xeukleides', editing the file created in the first
section, type:

     $ xeukleides triangle.euk

To start in viewing mode instead, add the `-V' option. You can switch
between modes, by pressing the escape key. Since the editing mode is
based on the GTK+ text editor widget, `xeukleides' has all the features
of a simple text editor. Here is a list of some useful shortcuts:

            `Alt-F'     One word forward.
            `Alt-B'     One word backward.
            `Alt-D'     Delete one word forward.
            `Ctrl-W'    Delete one word backward.
            `Ctrl-U'    Delete current line.
            `Ctrl-K'    Delete to end of line.
            `Ctrl-X'    Cut selection to clipboard.
            `Ctrl-C'    Copy selection to clipboard.
            `Ctrl-P'    Paste selection from clipboard.

   The drawn triangle is an optimal scalene triangle (i.e. it is an
acute triangle which shape is as far as possible from the shape of
right or isosceles triangles). You may want to draw another kind of
triangle. The language Eukleides provides a wide variety of ways to
define triangles. See what happens if you replace the `triangle'
command with `right', `isosceles' or `equilateral'.

   These commands can take some optional parameters. For instance:

     A B C triangle(6, 5, 4)

defines a triangle ABC such that AB = 6 cm, BC = 5 cm and AC = 4 cm.

   Another example:

     A B C isosceles(6, 50:)

defines an isosceles triangle ABC such that AB = 6 cm and the angles at
vertices A and B equal 50 degrees.


File: eukleides.info,  Node: A property of parallelograms,  Next: The theorem of Thales,  Prev: More about triangles,  Up: Tutorial

A property of parallelograms
============================

   We are now going to study the way to create a figure representing a
parallelogram, its center and diagonals. Furthermore the figure will
contain marks showing that the center is also midpoint of the diagonals.

   First we need to define the parallelogram and its center:

     A B C D parallelogram
     O = barycenter(A, B, C, D)

Then, we can draw them:

     draw(A, B, C, D) ; draw(O)

and the diagonals:

     draw(segment(A, C), dotted)
     draw(segment(B, D), dotted)

Finally, we draw the marks on the diagonals. Double dashes:

     mark(segment(O, A), double)
     mark(segment(O, C), double)

and crosses:

     mark(segment(O, B), cross)
     mark(segment(O, D), cross)


File: eukleides.info,  Node: The theorem of Thales,  Prev: A property of parallelograms,  Up: Tutorial

The theorem of Thales
=====================

   In this last section, we'll see an example of interactive geometric
figure for `xeukleides'. It shows that any triangle inscribed in a
semicircle has a right angle. With such a figure, it'll be possible to
move the vertex corresponding to the right angle on the semicircle by
pressing the left or right arrow keys. First, we define point A, point
B and circle C of diameter AB, with the following commands:

     A = point(0, 0) ; B = point(6, 0)
     C = circle(A, B)

Points A and B are here defined using coordinates. When nothing is
specified, the figure is drawn in a frame such that the lower left
point has coordinates (-2;-2) and the upper right (8;6). After this, we
define an interactive variable `t':

     t interactive(60, -2, 0, 180, "A", right)

This means that the initial value of `t' is 60, the lower bound 0, the
upper bound 180. In viewing mode, every time the right (left) arrow key
will be pressed, -2 will be added (subtracted) to this variable.
Instead of `right', it is also possible to use keyword `up', in order
to bind the variable to the up and down arrow keys. Last, `"A"'
indicates which state corresponds to the variable. When viewing mode is
started, the program is in state A.  There are 26 available states,
from A to Z, hence one can define 52 interactive variables for the same
figure. To switch from a state to another, one just has to hit the
corresponding key. We now define a point M on circle C with:

     M = point(C, t:)

The second parameter is followed by a colon to indicate that it's an
angular parameter. Variable `t' corresponds to the argument (in
degrees) of point M in respect of the center of C. Then, we draw the
upper half of circle C and triangle ABM, which has a right angle at
vertex M.

     color(lightgray)
     draw(C, 0:, 180:)
     color(black)
     draw(A, B, M)

Last, we draw the usual right angle mark:

     mark(A, M, B, right)

   It is possible to capture the actual value of variable `t' by
pressing the `F1' key. In this case, the initial value of `t' in the
source code is replaced by the actual value and the program switches to
editing mode. All source codes written for `xeukleides' can be used
with `eukleides' (the interactive variables are simply set to their
initial values).


File: eukleides.info,  Node: Reference,  Next: Samples,  Prev: Tutorial,  Up: Top

Reference
*********

   This chapter is a comprehensive reference manual for the language
Eukleides.

* Menu:

* Syntax::
* Numbers::
* Vectors::
* Points::
* Lines::
* Segments::
* Circles::
* Conics::
* Triangles::
* Polygons::
* Interactive assignments::
* Setting commands::
* Drawing commands::
* Trace commands::
* PSTricks::


File: eukleides.info,  Node: Syntax,  Next: Numbers,  Up: Reference

Syntax
======

   A Eukleides source file can contain:

   * Comments, i.e. all characters after a `%' to end of line.

   * Simple assignments, i.e. a variable name followed by `=' and an
     expression.

   * Multiple assignments, i.e. a space delimited sequence of variable
     names, followed (without `=') by a multiple assignment command
     (triangle assignment, polygon assignment, intersection assignment
     ...).

   * Interactive assignments, i.e. a variable name followed by the
     keyword `interactive' with some parameters.

   * Graphical commands, i.e. parameter setting commands, drawing
     commands or trace commands.

   Variable names are alphanumeric and case sensitive, the first
character has to be a letter. Variables can store various objects:
number, vector, line, segment, circle, conic curve. A line of the
source file can contain more than one assignment or command. (In this
case they must be separated by semicolons.  A semicolon at the end of
the line is allowed but not necessary.)

   We'll use the following notations to describe the parameters in a
command:

   * x, y, z : number.

   * a, b : angular parameter.

   * A, B, C, D, E, F, G : point.

   * u, v : vector.

   * l : line.

   * s : segment.

   * c : circle.

   * cc : conic curve.

   * str : string.

   * f : flag.

   An angular parameter is a number valued expression followed by `:'
(degrees) or `<' (radians). A string is any single line text enclosed in
double quotes. With `xeukleides', in order to improve displaying of
texts, dollar signs are skipped in strings.

   We'll use square brackets to indicate optional parameters.


File: eukleides.info,  Node: Numbers,  Next: Vectors,  Prev: Syntax,  Up: Reference

Numbers
=======

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

   The available numerical functions are: `abs(x)', `sqrt(x)',
`exp(x)', `ln(x)', `sin(x)', `cos(x)', `tan(x)', `asin(x)', `acos(x)',
`atan(x)', `deg(x)' (to convert radians in degrees), `rad(x)' (to
convert degrees in radians).

   There is one constant: `pi'.

   Next, the following number valued functions are also available:

   * `abscissa(A)' or `abscissa(u)'

   * `ordinate(A)' or `ordinate(u)'

   * `distance(A, B)' or `distance(A, l)'

   * `length(u)' or `length(s)'

   * `radius(c)'

   * `major(cc)'
     Half of the major axis if cc is an ellipse; half of the real axis
     if cc is an hyperbola; semifocal chord if cc is a parabola.

   * `minor(cc)'
     Half of the minor axis if cc is an ellipse; half of the imaginary
     axis if cc is an hyperbola; zero if cc is a parabola.

   * `eccentricity(cc)'

   * `arg(cc, A)'
     Argument of point A in respect of the internal parametric
     representation of cc. If A isn't on cc, `arg' returns the argument
     of the image of A by a projection on cc. The direction of the
     projection is the one of the principal axis if cc is a parabola,
     of the center if cc is an ellipse, of the major axis if cc is an
     hyperbola.

   * `height(A, B, C)'
     Distance between point B and line AC.

   Last, there are all the angle measure functions. The result is in
degrees.  Eukleides handles directed angles, hence `angle' returns a
signed number greater than -180 degrees and smaller than or equal to
180 degrees.

   * `angle(u)' or `angle(l)' or `angle(s)'
     Polar angle of the object.

   * `angle(cc)'
     Polar angle of the principal axis of conic curve cc.

   * `angle(u, v)'
     Measure of the angle between vector u and vector v.

   * `angle(A, B, C)'
     Measure of the angle under ABC. (The angle under ABC is the
     angular sector in which one can draw counterclockwise an arc of
     center B from point A to line BC.  Therefore the angle under ABC is
     different from the angle under CBA.)


File: eukleides.info,  Node: Vectors,  Next: Points,  Prev: Numbers,  Up: Reference

Vectors
=======

   To compute usual vectorial operations, use the symbols: `(', `)',
`+', `-', `*' (multiplication by a number or scalar product of two
vectors), `/' (division by a number).

   Here are all the vector valued functions:

   * `vector(x, y)'
     Vector of abscissa x and ordinate y.

   * `vector(x, a)'
     Vector of length x and argument a.

   * `vector(A, B)'
     Vector from point A to point B.

   * `vector(l)'
     Unit length vector with same direction than line l.

   * `vector(s)'
     Vector from begin of segment s to end of s.

   * `rotation(u, a)'


File: eukleides.info,  Node: Points,  Next: Lines,  Prev: Vectors,  Up: Reference

Points
======

   Here are all the point valued functions:

   * `point(x, y)'
     Point of abscissa x and ordinate y.

   * `point(x, a)'
     Point of radial coordinate x and polar angle a.

   * `point(l, x)'
     Point of abscissa x on the graduated line l. (With Eukleides,
     lines have an implicit orientation.)

   * `point(s, x)'
     Point of abscissa x on the graduated line containing segment s.
     (The origin is set to the begin of s. Like lines, segments have an
     implicit orientation.)

   * `point(c, a)'
     Point of argument a (in degrees) on circle c.

   * `point(cc, x)'
     Point on conic curve cc. Number x is the argument for the internal
     parametric representation of cc. For parabolas, the representation
     is based on square function; for ellipses, on cosine and sine; for
     hyperbolas, on cosecant and tangent.

   * `barycenter(A [, x], B [, y])'
     Barycenter of A and B with coefficient x and y (default: 1 and 1).
     The syntax is similar for 3 or 4 points.

   * `intersection(l, l')'
     Intersection point of lines l and l'.

   * `abscissa(l, x)'
     Point of abscissa x on line l.

   * `ordinate(l, y)'
     Point of ordinate y on line l.

   * `midpoint(s)'

   * `begin(s)'

   * `end(s)'

   * `center(c)'

   * `center(cc)'
     If cc is a parabola, the result is its vertex.

   * `orthocenter(A, B, C)'
     Orthocenter of triangle ABC.

   * `translation(A, u)'

   * `reflection(A, l)'

   * `rotation(A, B [, a])'
     Rotation of center B and angle a (default: 180 degrees).

   * `homothecy(A, B, x)'
     Homothecy, i.e. expansion or dilation, of center B and ratio x.

   * `projection(A, l [, l'])'
     Projection of point A on line l in direction of line l' (default:
     perpendicular to line l).


File: eukleides.info,  Node: Lines,  Next: Segments,  Prev: Points,  Up: Reference

Lines
=====

   With Eukleides, the internal representation of lines is based on an
abscissa, an ordinate and a polar angle. Therefore lines have an
implicit orientation.  Here are all the line valued functions:

   * `line(A, B)'

   * `line(A, u)'

   * `line(s)'

   * `line(A, a)'
     Line of polar angle a, containing point A.

   * `line(c, a)'
     Tangent line of circle c at point of argument a (in respect of the
     center of c).

   * `line(cc, x)'
     Tangent line of cc at point of argument x (in respect of the
     internal parametric representation). For parabolas, the
     representation is based on square function; for ellipses, on
     cosine and sine; for hyperbolas, on cosecant and tangent.

   * `parallel(l, A)' or `parallel(s, A)'

   * `perpendicular(l, A)' or `perpendicular(s, A)'

   * `bisector(s)'
     Perpendicular bisector of segment s.

   * `bisector(A, B, C)'
     Bisector of angle under ABC.

   * `bisector(l, l')'
     Bisector of the sharp angle formed by l and l'.

   * `altitude(A, B, C)'
     Altitude of triangle ABC containing vertex A.

   * `median(s)'

   * `translation(l, u)'

   * `reflection(l, l')'
     Reflection in respect of line l'.

   * `rotation(l, A [, a])'
     Rotation of center A and angle a (default: 180 degrees).

   * `homothecy(l, A, x)'
     Homothecy, i.e. expansion or dilation, of center A and ratio x.


File: eukleides.info,  Node: Segments,  Next: Circles,  Prev: Lines,  Up: Reference

Segments
========

   With Eukleides, the internal representation of segments is based on
a begin point and an end point. Therefore segments have an implicit
orientation. Here are all the segment valued functions:

   * `segment(A, B)'

   * `segment(A, u)'

   * `segment(A, x, a)'
     Segment of length x and polar angle a, beginning with A.

   * `segment(c, a)'
     Segment from center of circle c to point of argument a (in respect
     of the center of c).

   * `translation(s, u)'

   * `reflection(s, l)'

   * `rotation(s, A [, a])'
     Rotation of center A and angle a (default: 180 degrees).

   * `homothecy(s, A, x)'
     Homothecy, i.e. expansion or dilation, of center A and ratio x.


File: eukleides.info,  Node: Circles,  Next: Conics,  Prev: Segments,  Up: Reference

Circles
=======

   Here are all the circle valued functions:

   * `circle(A, B)'
     Circle of diameter AB.

   * `circle(A, B, C)'
     Circumcircle of triangle ABC.

   * `circle(A, x)'
     Circle of center A and radius x.

   * `incircle(A, B, C)'

   * `translation(c, u)'

   * `reflection(c, l)'

   * `rotation(c, A [, a])'
     Rotation of center A and angle a (default: 180 degrees).

   * `homothecy(c, A, x)'
     Homothecy, i.e. expansion or dilation, of center A and ratio x.

   There are also the two following multiple assignments:
   * `A B intersection(l, c)'

   * `A B intersection(c, c')'
   If the two object are tangent, the two variables will be set to the
same point.


File: eukleides.info,  Node: Conics,  Next: Triangles,  Prev: Circles,  Up: Reference

Conics
======

   Here are all the conic curves valued functions:

   * `conic(A, l, x)'
     Conic curve of focus A, directrix l and eccentricity x.

   * `conic(A, B, x)'
     Conic curve of foci A and B. Number x is the half of the distance
     between the vertices (i.e. major axis for ellipses, or real axis
     for hyperbolas).

   * `parabola(A, l)'
     Parabola of focus A and directrix l.

   * `parabola(A, x, a)'
     Parabola of center A, such that x equals the semifocal chord and a
     the measure of the angle between the principal axis and the
     horizontal direction.

   * `ellipse(A, x, y, a)'
     Ellipse of center A, such that x equals the half of the major
     axis, y the half of the minor axis and a the polar angle of the
     principal axis.

   * `hyperbola(A, x, y, a)'
     Hyperbola of center A, such that x equals the half of the real
     axis, y the half of the imaginary axis and a the polar angle of
     the principal axis.

   * `translation(cc, u)'

   * `reflection(cc, l)'

   * `rotation(cc, A [, a])'
     Rotation of center A and angle a (default: 180 degrees).

   * `homothecy(cc, A, x)'
     Homothecy, i.e. expansion or dilation, of center A and ratio x.

   There are also the three following multiple assignments:

   * `A B foci(cc)'

   * `A B vertices(cc)'

   * `A B intersection(l, cc)'


File: eukleides.info,  Node: Triangles,  Next: Polygons,  Prev: Conics,  Up: Reference

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 is constructed from this point. If not, the point
is set to origin.  The optional parameter b is the polar angle of
segment AB (default: 0 degrees). Here are all the ways to define a
triangle:

   * `A B C triangle[(x [, b])]'
     Defines a scalene triangle with AB = x (default: 6). The triangle
     is an optimal scalene triangle (i.e. an acute triangle which shape
     is as far as possible from the shape of right or isosceles
     triangles).

   * `A B C triangle(x, y, z [, b])'
     Defines a scalene triangle with AB = x, BC = y and  AC = z.

   * `A B C triangle(x, a, a' [, b])]'
     Defines a scalene triangle with AB = x, measure of the angle under
     BAC equals a, measure of the angle under CBA equals a'.

   * `A B C right[(x, y [, a])]'
     Defines a right triangle (right angle in A) with AB = x and AC = y
     (default: 6 and 4.5).

   * `A B C right(x, a [, b])'
     Defines a right triangle (right angle in B) with AB = x and
     measure of the angle under BAC equals a.

   * `A B C isosceles[(x, a [, b])]'
     Defines an isosceles triangle with AB = x and measure of the angle
     under BAC and angle under CBA equal a (default: 6 and 39 degrees).

   * `A B C isosceles(x, y [, b])'
     Defines an isosceles triangle with AB = x and AC = BC = y.

   * `A B C equilateral[(x [, b])]'
     Defines an equilateral triangle of side length x (default: 6).


File: eukleides.info,  Node: Polygons,  Next: Interactive assignments,  Prev: Triangles,  Up: Reference

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 is constructed from this point.  If not, the point is set
to origin. The optional parameter b is the polar angle of segment AB
(default: 0 degrees). Here are all the ways to define a quadrilateral:

   * `A B C D parallelogram[(x, y, a [, b])]'
     Defines a parallelogram with AB = x, AD = y and angle under BAD
     equals a (default: 5, 4 and 75 degrees).

   * `A B C D parallelogram(u, v [, b])'
     Defines a parallelogram with vector from A to B equals u and
     vector from A to D equals v.

   * `A B C D rectangle[(x, y [, b])]'
     Defines a rectangle with AB = x and AD = y (default: 6 and 6 /
     `golden ratio').

   * `A B C D square[(x [, b])]'
     Defines a square with AB = x (default: 4).

   A pentagon assignment is the following command:

   * `A B C D E pentagon(F, x, a)'
     It defines a pentagon of center F, radius x and such as polar
     angle of segment FA equals a.

   An hexagon assignment is the following command:

   * `A B C D E F hexagon(G, x, a)'
     It defines an hexagon of center G, side length x and such as polar
     angle of segment GA equals a.


File: eukleides.info,  Node: Interactive assignments,  Next: Setting commands,  Prev: Polygons,  Up: Reference

Interactive assignments
=======================

   An interactive assignment is the following command:

   * `x interactive(y, z, [ x', x'',] str, f)'

   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 x' and x" are the lower and
upper bounds 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 f 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).


File: eukleides.info,  Node: Setting commands,  Next: Drawing commands,  Prev: Interactive assignments,  Up: Reference

Setting commands
================

   Here are all the setting commands:

   * `box(x, y, x', y' [, z])'

   * `frame(x, y, x', y' [, z])'
     With `eukleides', sets the visible frame (the two commands have
     similar effects). The lower-left corner has coordinates (x, y) and
     the upper-right corner (x', y'), the optional parameter sets the
     unit length to z cm (default: 1).

     With `xeukleides', the figure is drawn using the largest scale
     such that the given frame fits into the drawing area. Command
     `box' sets the visible frame, therefore the figure is usually
     surrounded by two gray stripes. Command `frame' sets the least
     visible frame, hence the entire drawing area is used. Parameter z
     has no effect.

     If no frame is given it is set to default frame: (-2, -2, 8, 6).

   * `color(f)'
     Sets color to f. Permitted values of f are `black' (default),
     `darkgray', `gray', `lightgray', `white', `red', `green', `blue',
     `cyan', `magenta' and `yellow'.

   * `color str'
     With `eukleides', sets color to str (it has to be a valid pstricks
     color). With `xeukleides', it has no effect.

   * `thickness(x)'
     With `eukleides', multiplies the current linewidth by x. The
     default linewidth is 0.5 pt. With `xeukleides', it has no effect.

   * `style(f)'
     Sets the current drawing style to f. Permitted values of f are
     `full', `dashed' and `dotted'. The default drawing style is `full'.

   * `tricks str'
     With `eukleides', adds an initial `\' to str and puts it verbatim
     to the output. It has to be valid TeX code. With `xeukleides', it
     has no effect.

   * `font str'
     With `xeukleides', changes current font. String str has to be a
     valid XLFD. With `eukleides', it has no effect.


File: eukleides.info,  Node: Drawing commands,  Next: Trace commands,  Prev: Setting commands,  Up: Reference

Drawing commands
================

   Here are all the drawing commands:

   * `draw(A [, f [, x]])'
     Draws point A with a shape corresponding to f and a scaling ratio
     x (default: 1). Permitted values of f are `dot', `box', `cross'
     and `plus' (default: `dot'). The scaling ratio has no effect with
     `xeukleides'.

   * `draw(u, A [, f])'
     Draws vector u from point A. If f is given, it overrides the
     current drawing style. Permitted values of f are `full', `dashed'
     and `dotted'.

   * `draw(l [, f [, f']])'
     Draws line l. If f is given, it overrides the current drawing
     style. Permitted values of f are `full', `dashed' and `dotted'.
     Permitted values of f' are `entire', `halfline' and `backhalfline'
     (default:  `entire').

   * `draw(s [, f [, f']])'
     Draws segment s. If f is given, it overrides the current drawing
     style. Permitted values of f are `full', `dashed' and `dotted'.
     Permitted values of f' are `noarrow', `arrow', `backarrow' and
     `doublearrow' (default: `noarrow').

   * `draw(c [, f])'
     Draws circle c. If f is given, it overrides the current drawing
     style. Permitted values of f are `full', `dashed' and `dotted'.

   * `draw(c, a, a', [, f [, f']])'
     Draws an arc of circle c from point of argument a to point of
     argument a'. If f is given, it overrides the current drawing
     style. Permitted values of f are `full', `dashed' and `dotted'.
     Permitted values of f' are `noarrow', `arrow', `backarrow' and
     `doublearrow' (default: `noarrow').

   * `draw(cc [, f])'
     Draws conic curve cc. If f is given, it overrides the current
     drawing style. Permitted values of f are `full', `dashed' and
     `dotted'.

   * `draw(cc, x, y [, f])'
     Draws an arc of conic curve cc. Number x is the argument of the
     start point (in respect of the internal parametric representation
     of cc), number y is the argument of the end point. If f is given,
     it overrides the current drawing style. Permitted values of f are
     `full', `dashed' and `dotted'.

   * `draw(A, B, C, [, f])'
     Draws triangle ABC. If f is given, it overrides the current
     drawing style. Permitted values of f are `full', `dashed' and
     `dotted'.

   * `draw(A, B, C, D [, f])'
     Draws quadrilateral ABCD. If f is given, it overrides the current
     drawing style.  Permitted values of f are `full', `dashed' and
     `dotted'.

   * `draw(A, B, C, D, E, [, f])'
     Draws pentagon ABCDE. If f is given, it overrides the current
     drawing style. Permitted values of f are `full', `dashed' and
     `dotted'.

   * `draw(A, B, C, D, E, F [, f])'
     Draws hexagon ABCDEF. If f is given, it overrides the current
     drawing style. Permitted values of f are `full', `dashed' and
     `dotted'.

   * `draw(str, A, [ x, ] a)'
     Prints the text contained in str at a distance x (default: 0.3)
     and with argument a in respect of point A.

   * `draw(str, s, [ x, ] a)'
     Prints the text contained in str at a distance x (default: 0.3)
     and with argument a in respect of the midpoint of segment s.

   * `draw(x, [str, ] A, [ y, ] a)'
     Prints the value of x optionally formated with str (using the C
     language syntax) at a distance y (default: 0.3) and with argument
     a in respect of point A.

   * `draw(x, [str, ] s, [ y, ] a)'
     Prints the value of x optionally formated with str (using the C
     language syntax) at a distance y (default: 0.3) and with argument
     a in respect of the midpoint of segment s.

   * `draw(x, x', str, A, [ y,] a)'
     Prints the values of x and x' formated with str (using the C
     language syntax) at a distance y (default: 0.3) and with argument
     a in respect of point A.

   * `draw(x, x', str, s, [ y,] a)'
     Prints the values of x and x' formated with str (using the C
     language syntax) at a distance y (default: 0.3) and with argument
     a in respect of the midpoint of segment s.

   * `mark(s [, f [, x]])'
     Marks the segment s with a symbol corresponding to f and a scaling
     ratio x (default: 1). Permitted values of f are `simple',
     `double', `triple' and `cross' (default: `simple').

   * `mark(A, B, C [, f [, x]])'
     Marks the angle under ABC with a symbol corresponding to f and a
     scaling ratio x (default: 1). Permitted values of f are `simple',
     `double', `triple', `dashed' (which yields a curved angle mark
     with a dash), `right', `dotted' (which yields a right angle mark
     with a centered dot), `arrow' and `backarrow' (default: `simple').


File: eukleides.info,  Node: Trace commands,  Next: PSTricks,  Prev: Drawing commands,  Up: Reference

Trace commands
==============

   A trace command allows to draw the locus of a point depending on a
numerical variable. It has the following syntax:

   * `trace(x, x', x'' [, f])'

   This statement has to be followed by at least one point valued
expression enclosed in braces (depending on variable x). Parameters x'
and x" are the lower and upper bounds of x. The expression has to be
defined for each value of the interval. If not, it may lead to spurious
results or sometimes (with `eukleides') to an error message. Within the
braces, in order to perform intermediate computations, it is possible
to add any sequence of statements before the expression. If f is given,
it overrides the current drawing style. Permitted values of f are
`full', `dashed' and `dotted'.


File: eukleides.info,  Node: PSTricks,  Prev: Trace commands,  Up: Reference

PSTricks
========

   The program `eukleides' allows to include arbitrary PSTricks macros
with parameters computed itself. Probably most usefully, it allows
arbitrary PSTricks graphics objects to be drawn with coordinates
generated by a Eukleides construction.

   The syntax is meant to be reasonably close to how one would enter
PSTricks code directly into a TeX document. A PSTricks macro starts
with a backslash, followed by the PSTricks macro name (e.g. `pscircle').
There may be an optional list of PSTricks options, enclosed in square
brackets (i.e. `[]'), and an optional list of parameters, enclosed in
parentheses. We first give a simple example illustrating all of these
features, and then explain the syntax in detail.

     A B C equilateral
     draw(A, B, C, dotted)
     \pscurve[arrows="->"](A, B, C)

   This draws an interpolated spline through the vertices of an
equilateral triangle.

   The detailed syntax is explained below.

* Menu:

* Options::
* Parameters::
* Caveats::


File: eukleides.info,  Node: Options,  Next: Parameters,  Up: PSTricks

Options
-------

   Options should be given in form `option=value' where `option' is a
legitimate PSTricks option name and `value' is either a quoted string
(e.g. `arrows="->"') or a Eukleides numerical expression (e.g.
`radius=distance(A,B)').  Quotes are removed from strings before
emitting PSTricks code. All documented option names should work
unquoted, but in case of problems, you can enclose the option name in
quotes (e.g.  `"obscureParameter"=3.145').

   The following modifies the first example of this section making the
lines thicker and drawing the control points of the curve.

     A B C equilateral
     draw(A, B, C, dotted)
     \pscurve[showpoints="true", linewidth=.05, arrows="->"](A, B, C)


File: eukleides.info,  Node: Parameters,  Next: Caveats,  Prev: Options,  Up: PSTricks

Parameters
----------

   Parameters to PSTricks macros should be given as a comma separated
list of point expressions, numerical expressions, or quoted strings.
Points are output in form `(x,y)' and quoted strings and numerical
expressions are output inside braces. This means that the statement:

     \psline("<<->>", A, B)

is translated into the following PSTricks code:

     \psline{<<->>}(0.0000,0.0000)(6.0000,0.0000)


File: eukleides.info,  Node: Caveats,  Prev: Parameters,  Up: PSTricks

Caveats
-------

   This brief documentation cannot hope to explain PSTricks to a
novice. For more information, you are referred to the documention
included with PSTricks, or to the book "The LaTeX Graphics Companion"
by M. Goosens, F. Mittelbach and S. Rahtz. To make matters worse, no
checking is done to the PSTricks code generated. This means that it is
easy to generate syntactically incorrect TeX using this feature of
`eukleides'. Finally, all PSTricks macros are currently ignored by
`xeukleides'.


File: eukleides.info,  Node: Samples,  Next: Contact,  Prev: Reference,  Up: Top

Samples
*******

   The following samples are intended to illustrate the basic features
of Eukleides. There are two other sets of samples: one for `eukleides',
picked up from geometry exercises; an other for `xeukleides', giving
examples of interactive geometric figures.

* Menu:

* Incircle and bisectors::
* Feuerbach circle::
* Isosceles triangle::
* Collinear points::
* Angles in a parallelogram::
* Addition of vectors::
* Tangents to a circle::
* A spiral::
* A parabola with focus and directrix::


File: eukleides.info,  Node: Incircle and bisectors,  Next: Feuerbach circle,  Up: Samples

Incircle and bisectors
======================

     A B C triangle
     draw(A, B, C)
     draw(incircle(A, B, C))
     draw(bisector(B, A, C), dotted)
     draw(bisector(A, B, C), dotted)
     draw(bisector(B, C, A), dotted)


File: eukleides.info,  Node: Feuerbach circle,  Next: Isosceles triangle,  Prev: Incircle and bisectors,  Up: Samples

Feuerbach circle
================

     A B C triangle
     a = projection(A, line(B, C))
     b = projection(B, line(A, C))
     c = projection(C, line(A, B))
     draw(A, B, C)
     draw(a) ; draw(b) ; draw(c)
     draw(segment(A, a), dotted)
     draw(segment(B, b), dotted)
     draw(segment(C, c), dotted)
     draw(barycenter(A, B))
     draw(barycenter(B, C))
     draw(barycenter(C, A))
     draw(circle(a, b, c))


File: eukleides.info,  Node: Isosceles triangle,  Next: Collinear points,  Prev: Feuerbach circle,  Up: Samples

Isosceles triangle
==================

     A B C isosceles
     H = projection(C, line(A, B))
     draw(A, B, C)
     draw(H)
     draw(segment(C, H), dashed)
     mark(B, H, C, right)
     mark(segment(A, H))
     mark(segment(B, H))
     mark(segment(A, C), cross)
     mark(segment(C, B), cross)
     mark(B, A, C, double)
     mark(C, B, A, double)


File: eukleides.info,  Node: Collinear points,  Next: Angles in a parallelogram,  Prev: Isosceles triangle,  Up: Samples

Collinear points
================

     A B C D square
     A B E equilateral(4)
     B F G equilateral(4, 30:)
     draw(A, B, C, D)
     draw(A, B, E)
     draw(B, F, G)
     draw(line(E, F), dotted)


File: eukleides.info,  Node: Angles in a parallelogram,  Next: Addition of vectors,  Prev: Collinear points,  Up: Samples

Angles in a parallelogram
=========================

     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)


File: eukleides.info,  Node: Addition of vectors,  Next: Tangents to a circle,  Prev: Angles in a parallelogram,  Up: Samples

Addition of 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)


File: eukleides.info,  Node: Tangents to a circle,  Next: A spiral,  Prev: Addition of vectors,  Up: Samples

Tangents to a circle
====================

     O = point(2, 2)
     C = circle(O, 2)
     A = point(6.5, 2)
     c = circle(O, A)
     I J intersection(C, c)
     color(lightgray)
     draw(line(A, I))
     draw(line(A, J))
     color(black)
     draw(O, plus)
     draw(A)
     draw(C)
     draw(c, dotted)


File: eukleides.info,  Node: A spiral,  Next: A parabola with focus and directrix,  Prev: Tangents to a circle,  Up: Samples

A spiral
========

     frame(-5, -4, 5, 4)
     trace(t, 0, 3*360)
     { point(t/360, t:) }


File: eukleides.info,  Node: A parabola with focus and directrix,  Prev: A spiral,  Up: Samples

A parabola with focus and directrix
===================================

     F = point(3, 1.5)
     D = line(point(1, 0.5), -65:)
     C = parabola(F, D)
     draw(F)
     draw(D)
     draw(C)


File: eukleides.info,  Node: Contact,  Next: Concept index,  Prev: Samples,  Up: Top

Contact
*******

Eukleides has been created by Christian Obrecht.

Up to now, the canonical homepage for Eukleides is
<http://perso.wanadoo.fr/obrecht/>.

Please send bug reports and comments to <christian.obrecht@wanadoo.fr>.


File: eukleides.info,  Node: Concept index,  Next: Command index,  Prev: Contact,  Up: Top

Concept index
*************

* Menu:

* Altitude:                              Lines.
* Angles:                                Numbers.
* Angular parameters:                    Syntax.
* Arithmetical operations:               Numbers.
* Assignments:                           Syntax.
* Barycenter:                            Points.
* Bisector:                              Lines.
* Case sensitivity:                      Syntax.
* Center:                                Points.
* Circle valued functions:               Circles.
* Colors:                                Setting commands.
* Comments:                              Syntax.
* Conic curves:                          Conics.
* Conic curves parameters:               Numbers.
* Default frame:                         The theorem of Thales.
* Distance:                              Numbers.
* Drawing commands:                      Drawing commands.
* Drawing style:                         Setting commands.
* Equilateral triangles:                 Triangles.
* euk2edit:                              Drawing a triangle.
* euk2eps:                               Drawing a triangle.
* eukleides:                             Drawing a triangle.
* Foci:                                  Conics.
* Fonts:                                 Setting commands.
* Graduated line:                        Points.
* Height:                                Numbers.
* Hexagons:                              Polygons.
* Homothecy <1>:                         Segments.
* Homothecy <2>:                         Circles.
* Homothecy <3>:                         Points.
* Homothecy <4>:                         Lines.
* Homothecy:                             Conics.
* Implicit orientation <1>:              Lines.
* Implicit orientation:                  Segments.
* Interactive assignments <1>:           Interactive assignments.
* Interactive assignments:               The theorem of Thales.
* Interactive figures:                   The theorem of Thales.
* Internal representation <1>:           Segments.
* Internal representation:               Lines.
* Intersection <1>:                      Points.
* Intersection <2>:                      Circles.
* Intersection:                          Conics.
* Isosceles triangles:                   Triangles.
* Keyboard shortcuts:                    More about triangles.
* Length:                                Numbers.
* Line valued functions:                 Lines.
* Marks <1>:                             A property of parallelograms.
* Marks:                                 Drawing commands.
* Median:                                Lines.
* Midpoint:                              Points.
* Multiple assignments <1>:              Syntax.
* Multiple assignments:                  Conics.
* Number valued functions:               Numbers.
* Numerical functions:                   Numbers.
* Oriented angles:                       Numbers.
* Orthocenter:                           Points.
* Parallel:                              Lines.
* Parallelograms:                        Polygons.
* Pentagons:                             Polygons.
* Perpendicular:                         Lines.
* Point valued functions:                Points.
* Polar angle:                           Lines.
* Polygons:                              Polygons.
* Printing numbers:                      Drawing commands.
* Printing strings:                      Drawing commands.
* Projection:                            Points.
* pstoedit:                              Drawing a triangle.
* PSTricks <1>:                          PSTricks.
* PSTricks:                              Setting commands.
* Quadrilaterals <1>:                    Polygons.
* Quadrilaterals:                        A property of parallelograms.
* Radius:                                Numbers.
* Rectangles:                            Polygons.
* Reflection <1>:                        Lines.
* Reflection <2>:                        Conics.
* Reflection <3>:                        Segments.
* Reflection <4>:                        Points.
* Reflection:                            Circles.
* Right triangles:                       Triangles.
* Rotation <1>:                          Segments.
* Rotation <2>:                          Vectors.
* Rotation <3>:                          Lines.
* Rotation <4>:                          Points.
* Rotation <5>:                          Circles.
* Rotation:                              Conics.
* Scalar product:                        Vectors.
* Scalene triangles <1>:                 More about triangles.
* Scalene triangles:                     Triangles.
* Segment valued functions:              Segments.
* Setting commands:                      Setting commands.
* Simple assignments:                    Syntax.
* Snapshot:                              The theorem of Thales.
* Squares:                               Polygons.
* Strings:                               Syntax.
* Syntax:                                Syntax.
* Thickness:                             Setting commands.
* Trace commands:                        Trace commands.
* Translation <1>:                       Circles.
* Translation <2>:                       Points.
* Translation <3>:                       Lines.
* Translation <4>:                       Segments.
* Translation:                           Conics.
* Triangles <1>:                         Drawing a triangle.
* Triangles <2>:                         Points.
* Triangles <3>:                         More about triangles.
* Triangles:                             Triangles.
* Variable names:                        Syntax.
* Vector valued functions:               Vectors.
* Vectorial operations:                  Vectors.
* Vectors:                               Vectors.
* Vertices:                              Conics.
* Visible frame:                         Setting commands.
* xeukleides:                            More about triangles.


File: eukleides.info,  Node: Command index,  Prev: Concept index,  Up: Top

Command index
*************

* Menu:

* abs:                                   Numbers.
* abscissa <1>:                          Points.
* abscissa:                              Numbers.
* acos:                                  Numbers.
* altitude:                              Lines.
* angle:                                 Numbers.
* arg:                                   Numbers.
* arrow:                                 Drawing commands.
* asin:                                  Numbers.
* atan:                                  Numbers.
* backarrow:                             Drawing commands.
* backhalfline:                          Drawing commands.
* barycenter:                            Points.
* begin:                                 Points.
* bisector:                              Lines.
* black:                                 Setting commands.
* blue:                                  Setting commands.
* box <1>:                               Drawing commands.
* box:                                   Setting commands.
* center:                                Points.
* circle:                                Circles.
* color:                                 Setting commands.
* conic:                                 Conics.
* cos:                                   Numbers.
* cross:                                 Drawing commands.
* cyan:                                  Setting commands.
* darkgray:                              Setting commands.
* dashed:                                Drawing commands.
* deg:                                   Numbers.
* distance:                              Numbers.
* dot:                                   Drawing commands.
* dotted:                                Drawing commands.
* double:                                Drawing commands.
* doublearrow:                           Drawing commands.
* draw:                                  Drawing commands.
* eccentricity:                          Numbers.
* ellipse:                               Conics.
* end:                                   Points.
* entire:                                Drawing commands.
* equilateral:                           Triangles.
* exp:                                   Numbers.
* foci:                                  Conics.
* font:                                  Setting commands.
* frame:                                 Setting commands.
* full:                                  Drawing commands.
* gray:                                  Setting commands.
* green:                                 Setting commands.
* halfline:                              Drawing commands.
* height:                                Numbers.
* hexagon:                               Polygons.
* homothecy <1>:                         Circles.
* homothecy <2>:                         Conics.
* homothecy <3>:                         Segments.
* homothecy <4>:                         Lines.
* homothecy:                             Points.
* hyperbola:                             Conics.
* incircle:                              Circles.
* interactive:                           Interactive assignments.
* intersection <1>:                      Conics.
* intersection:                          Points.
* isosceles:                             Triangles.
* length:                                Numbers.
* lightgray:                             Setting commands.
* line:                                  Lines.
* ln:                                    Numbers.
* magenta:                               Setting commands.
* major:                                 Numbers.
* mark:                                  Drawing commands.
* median:                                Lines.
* midpoint:                              Points.
* minor:                                 Numbers.
* noarrow:                               Drawing commands.
* ordinate <1>:                          Numbers.
* ordinate:                              Points.
* orthocenter:                           Points.
* parabola:                              Conics.
* parallel:                              Lines.
* parallelogram:                         Polygons.
* pentagon:                              Polygons.
* perpendicular:                         Lines.
* pi:                                    Numbers.
* plus:                                  Drawing commands.
* point:                                 Points.
* projection:                            Points.
* rad:                                   Numbers.
* radius:                                Numbers.
* rectangle:                             Polygons.
* red:                                   Setting commands.
* reflection <1>:                        Segments.
* reflection <2>:                        Conics.
* reflection <3>:                        Points.
* reflection <4>:                        Lines.
* reflection:                            Circles.
* right <1>:                             Triangles.
* right <2>:                             Drawing commands.
* right:                                 Interactive assignments.
* rotation <1>:                          Conics.
* rotation <2>:                          Points.
* rotation <3>:                          Lines.
* rotation <4>:                          Vectors.
* rotation <5>:                          Segments.
* rotation:                              Circles.
* segment:                               Segments.
* simple:                                Drawing commands.
* sin:                                   Numbers.
* sqrt:                                  Numbers.
* square:                                Polygons.
* style:                                 Setting commands.
* tan:                                   Numbers.
* thickness:                             Setting commands.
* trace:                                 Trace commands.
* translation <1>:                       Segments.
* translation <2>:                       Circles.
* translation <3>:                       Lines.
* translation <4>:                       Points.
* translation:                           Conics.
* triangle:                              Triangles.
* tricks:                                Setting commands.
* triple:                                Drawing commands.
* up:                                    Interactive assignments.
* vector:                                Vectors.
* vertices:                              Conics.
* white:                                 Setting commands.
* yellow:                                Setting commands.



Tag Table:
Node: Top213
Node: Tutorial1103
Node: Drawing a triangle1444
Node: More about triangles3505
Node: A property of parallelograms5365
Node: The theorem of Thales6247
Node: Reference8662
Node: Syntax9080
Node: Numbers10799
Node: Vectors13015
Node: Points13687
Node: Lines15554
Node: Segments17028
Node: Circles17819
Node: Conics18605
Node: Triangles20044
Node: Polygons21768
Node: Interactive assignments23218
Node: Setting commands24214
Node: Drawing commands26127
Node: Trace commands30829
Node: PSTricks31707
Node: Options32786
Node: Parameters33575
Node: Caveats34093
Node: Samples34674
Node: Incircle and bisectors35265
Node: Feuerbach circle35586
Node: Isosceles triangle36130
Node: Collinear points36600
Node: Angles in a parallelogram36927
Node: Addition of vectors37259
Node: Tangents to a circle37637
Node: A spiral38059
Node: A parabola with focus and directrix38282
Node: Contact38576
Node: Concept index38892
Node: Command index44970

End Tag Table
