This is eukleides.info, produced by makeinfo version 4.8 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.2 of Eukleides's 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 1 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 1.1 Drawing a triangle ====================== The language Eukleides has been designed in order to be close to the traditional 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 1.2 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 1.3 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 1.4 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 2 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:: * Export commands::  File: eukleides.info, Node: Syntax, Next: Numbers, Up: Reference 2.1 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 `=' (optionally) and the keyword `interactive' with some parameters. * Graphical commands, i.e. parameter setting commands, drawing commands or trace commands. Variable names are case sensitive, the first character has to be a letter or an underscore character, further ones can be letters, digits, underscores or single quote characters. 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 or dollar symbols (which should be used for ``"$'' and ``$"''). We'll use square brackets to indicate optional parameters.  File: eukleides.info, Node: Numbers, Next: Vectors, Prev: Syntax, Up: Reference 2.2 Numbers =========== To compute usual arithmetical operations, use the symbols: `(', `)', `+', `-', `*', `/', `^' (for exponentiation). There's a C-like ternary test operator using the symbols `?' and `|'. To perform a test one may use the following comparison and logical operators: `==', `!=', `<=', `>=', `<', `>', `and', `or', `not'. The available numerical functions are: `abs(x)', `min(x)', `max(x)', `clamp(x, y, z)' (which returns x if y<=x<=z, y if xz), `sign(x)', (which returns -1 if x<0, 0 if x=0, 1 if x>0), `ceil(x)', `floor(x)', `round(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(c, A)' Argument of point A in respect of circle c. If A isn't on c, `arg' returns the argument of the image of A by a projection on c in the direction of its center. * `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 2.3 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 2.4 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 2.5 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(A, B, C)' Median of triangle ABC containing vertex A. * `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 2.6 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 2.7 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 2.8 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 2.9 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 when the second variable is not already defined as a point: * `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). Here are all the ways to define a triangle when the first and the second variables are already defined as points: * `A B C triangle(x, y)' Defines a scalene triangle with BC = x and AC = y. * `A B C triangle(a, a')' Defines a scalene triangle with measure of the angle under BAC equals a, measure of the angle under CBA equals a'. * `A B C right(x)' Defines a right triangle (right angle in A) with AC = x. * `A B C right(a)' Defines a right triangle (right angle in B) with measure of the angle under BAC equals a. * `A B C isosceles(a)' Defines an isosceles triangle with measure of the angle under BAC and angle under CBA equal a. * `A B C isosceles(x)' Defines an isosceles triangle with AC = BC = x. * `A B C equilateral' Defines an equilateral triangle.  File: eukleides.info, Node: Polygons, Next: Interactive assignments, Prev: Triangles, Up: Reference 2.10 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 when the second variable is not already defined as a point: * `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). Here are all the ways to define a quadrilateral when the first and the second variables are already defined as points: * `A B C D parallelogram(x, a)' Defines a parallelogram with AD = x and angle under BAD equals a. * `A B C D rectangle(x)' Defines a rectangle with AD = x. * `A B C D square' Defines a square. When the three first variables are already defined as points, one may also use: * `A B C D parallelogram' * `A B C D rectangle' 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 2.11 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 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). When the equal symbol is not present, one may capture the actual value of variable x. In this case, parameter y has to be a simple number (not an expression). When pressing the `F1' key, the initial value in the source code is replaced by the actual value and the program switches to editing mode.  File: eukleides.info, Node: Setting commands, Next: Drawing commands, Prev: Interactive assignments, Up: Reference 2.12 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. * `strokes(x)' Sets the number of strokes drawn by a `trace' command (default: 150). The minimal number of strokes is 3 and the maximal number is 300.  File: eukleides.info, Node: Drawing commands, Next: Trace commands, Prev: Setting commands, Up: Reference 2.13 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', `disc', `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. * `label(A, [ x, ] a)' Prints the name of variable A at a distance x (default: 0.3) and with argument a in respect of point A. * `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', `dot' (which yields a curved angle mark with a centered dot), `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 2.14 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, Next: Export commands, Prev: Trace commands, Up: Reference 2.15 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 (La)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 2.15.1 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 2.15.2 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 2.15.3 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: Export commands, Prev: PSTricks, Up: Reference 2.16 Export commands ==================== With `xeukleides', export commands allow to send numerical values to the standard output. With `eukleides', export commands do nothing. The syntax is the following: * `export(x, [ y, [ z ]])' When exporting more than one value, the numbers are separated with tabs.  File: eukleides.info, Node: Samples, Next: Contact, Prev: Reference, Up: Top 3 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 3.1 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 3.2 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 3.3 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 3.4 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 3.5 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 3.6 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 3.7 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 3.8 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 3.9 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://www.eukleides.org'. Please send bug reports and comments to .  File: eukleides.info, Node: Concept index, Next: Command index, Prev: Contact, Up: Top Concept index ************* [index] * Menu: * Altitude: Lines. (line 6) * Angles: Numbers. (line 60) * Angular parameters: Syntax. (line 55) * Arithmetical operations: Numbers. (line 6) * Assignments: Syntax. (line 6) * Barycenter: Points. (line 6) * Bisector: Lines. (line 6) * Case sensitivity: Syntax. (line 24) * Center: Points. (line 6) * Circle valued functions: Circles. (line 6) * Colors: Setting commands. (line 6) * Comments: Syntax. (line 6) * Comparison operators: Numbers. (line 9) * Conic curves: Conics. (line 6) * Conic curves parameters: Numbers. (line 22) * Default frame: The theorem of Thales. (line 15) * Distance: Numbers. (line 22) * Dollar symbols: Syntax. (line 55) * Drawing commands: Drawing commands. (line 6) * Drawing style: Setting commands. (line 6) * Equilateral triangles: Triangles. (line 6) * euk2edit: Drawing a triangle. (line 33) * euk2eps: Drawing a triangle. (line 33) * eukleides: Drawing a triangle. (line 16) * Export commands: Export commands. (line 6) * Foci: Conics. (line 44) * Fonts: Setting commands. (line 6) * Graduated line: Points. (line 6) * Height: Numbers. (line 22) * Hexagons: Polygons. (line 53) * Homothecy <1>: Points. (line 6) * Homothecy <2>: Conics. (line 6) * Homothecy <3>: Lines. (line 6) * Homothecy <4>: Circles. (line 6) * Homothecy: Segments. (line 6) * Implicit orientation <1>: Segments. (line 6) * Implicit orientation: Lines. (line 6) * Interactive assignments <1>: Interactive assignments. (line 6) * Interactive assignments: The theorem of Thales. (line 15) * Interactive figures: The theorem of Thales. (line 6) * Internal representation <1>: Segments. (line 6) * Internal representation: Lines. (line 6) * Intersection <1>: Circles. (line 29) * Intersection <2>: Points. (line 6) * Intersection: Conics. (line 44) * Isosceles triangles: Triangles. (line 6) * Keyboard shortcuts: More about triangles. (line 17) * Length: Numbers. (line 22) * Line valued functions: Lines. (line 6) * Logical operators: Numbers. (line 9) * Marks <1>: A property of parallelograms. (line 6) * Marks: Drawing commands. (line 6) * Median: Lines. (line 6) * Midpoint: Points. (line 6) * Multiple assignments <1>: Syntax. (line 6) * Multiple assignments: Conics. (line 44) * Number valued functions: Numbers. (line 22) * Numerical functions: Numbers. (line 13) * Oriented angles: Numbers. (line 60) * Orthocenter: Points. (line 6) * Parallel: Lines. (line 6) * Parallelograms: Polygons. (line 6) * Pentagons: Polygons. (line 47) * Perpendicular: Lines. (line 6) * Point valued functions: Points. (line 6) * Polar angle: Lines. (line 6) * Polygons: Polygons. (line 6) * Printing numbers: Drawing commands. (line 6) * Printing strings: Drawing commands. (line 6) * Projection: Points. (line 6) * pstoedit: Drawing a triangle. (line 33) * PSTricks <1>: Setting commands. (line 6) * PSTricks: PSTricks. (line 6) * Quadrilaterals <1>: Polygons. (line 6) * Quadrilaterals: A property of parallelograms. (line 6) * Radius: Numbers. (line 22) * Rectangles: Polygons. (line 6) * Reflection <1>: Conics. (line 6) * Reflection <2>: Points. (line 6) * Reflection <3>: Lines. (line 6) * Reflection <4>: Segments. (line 6) * Reflection: Circles. (line 6) * Right triangles: Triangles. (line 6) * Rotation <1>: Lines. (line 6) * Rotation <2>: Points. (line 6) * Rotation <3>: Segments. (line 6) * Rotation <4>: Circles. (line 6) * Rotation <5>: Vectors. (line 10) * Rotation: Conics. (line 6) * Scalar product: Vectors. (line 6) * Scalene triangles <1>: More about triangles. (line 27) * Scalene triangles: Triangles. (line 6) * Segment valued functions: Segments. (line 6) * Setting commands: Setting commands. (line 6) * Simple assignments: Syntax. (line 6) * Snapshot: The theorem of Thales. (line 47) * Squares: Polygons. (line 6) * Strings: Syntax. (line 55) * Syntax: Syntax. (line 6) * Test operator: Numbers. (line 9) * Thickness: Setting commands. (line 6) * Trace commands: Trace commands. (line 6) * Translation <1>: Points. (line 6) * Translation <2>: Conics. (line 6) * Translation <3>: Circles. (line 6) * Translation <4>: Segments. (line 6) * Translation: Lines. (line 6) * Triangles <1>: Drawing a triangle. (line 6) * Triangles <2>: Triangles. (line 6) * Triangles <3>: More about triangles. (line 6) * Triangles: Points. (line 6) * Variable names: Syntax. (line 24) * Vector valued functions: Vectors. (line 10) * Vectorial operations: Vectors. (line 6) * Vectors: Vectors. (line 10) * Vertices: Conics. (line 44) * Visible frame: Setting commands. (line 6) * xeukleides: More about triangles. (line 6)  File: eukleides.info, Node: Command index, Prev: Concept index, Up: Top Command index ************* [index] * Menu: * abs: Numbers. (line 13) * abscissa <1>: Points. (line 6) * abscissa: Numbers. (line 22) * acos: Numbers. (line 13) * altitude: Lines. (line 6) * and: Numbers. (line 9) * angle: Numbers. (line 60) * arg: Numbers. (line 22) * arrow: Drawing commands. (line 6) * asin: Numbers. (line 13) * atan: Numbers. (line 13) * backarrow: Drawing commands. (line 6) * backhalfline: Drawing commands. (line 6) * barycenter: Points. (line 6) * begin: Points. (line 6) * bisector: Lines. (line 6) * black: Setting commands. (line 6) * blue: Setting commands. (line 6) * box <1>: Setting commands. (line 6) * box: Drawing commands. (line 6) * ceil: Numbers. (line 13) * center: Points. (line 6) * circle: Circles. (line 6) * clamp: Numbers. (line 13) * color: Setting commands. (line 6) * conic: Conics. (line 6) * cos: Numbers. (line 13) * cross: Drawing commands. (line 6) * cyan: Setting commands. (line 6) * darkgray: Setting commands. (line 6) * dashed: Drawing commands. (line 6) * deg: Numbers. (line 13) * distance: Numbers. (line 22) * dot: Drawing commands. (line 6) * dotted: Drawing commands. (line 6) * double: Drawing commands. (line 6) * doublearrow: Drawing commands. (line 6) * draw: Drawing commands. (line 6) * eccentricity: Numbers. (line 22) * ellipse: Conics. (line 6) * end: Points. (line 6) * entire: Drawing commands. (line 6) * equilateral: Triangles. (line 6) * exp: Numbers. (line 13) * export: Export commands. (line 6) * floor: Numbers. (line 13) * foci: Conics. (line 44) * font: Setting commands. (line 6) * frame: Setting commands. (line 6) * full: Drawing commands. (line 6) * gray: Setting commands. (line 6) * green: Setting commands. (line 6) * halfline: Drawing commands. (line 6) * height: Numbers. (line 22) * hexagon: Polygons. (line 53) * homothecy <1>: Points. (line 6) * homothecy <2>: Lines. (line 6) * homothecy <3>: Circles. (line 6) * homothecy <4>: Conics. (line 6) * homothecy: Segments. (line 6) * hyperbola: Conics. (line 6) * incircle: Circles. (line 6) * interactive: Interactive assignments. (line 6) * intersection <1>: Points. (line 6) * intersection: Conics. (line 44) * isosceles: Triangles. (line 6) * label: Drawing commands. (line 6) * length: Numbers. (line 22) * lightgray: Setting commands. (line 6) * line: Lines. (line 6) * ln: Numbers. (line 13) * magenta: Setting commands. (line 6) * major: Numbers. (line 22) * mark: Drawing commands. (line 6) * max: Numbers. (line 13) * median: Lines. (line 6) * midpoint: Points. (line 6) * min: Numbers. (line 13) * minor: Numbers. (line 22) * noarrow: Drawing commands. (line 6) * not: Numbers. (line 9) * or: Numbers. (line 9) * ordinate <1>: Points. (line 6) * ordinate: Numbers. (line 22) * orthocenter: Points. (line 6) * parabola: Conics. (line 6) * parallel: Lines. (line 6) * parallelogram: Polygons. (line 6) * pentagon: Polygons. (line 47) * perpendicular: Lines. (line 6) * pi: Numbers. (line 20) * plus: Drawing commands. (line 6) * point: Points. (line 6) * projection: Points. (line 6) * rad: Numbers. (line 13) * radius: Numbers. (line 22) * rectangle: Polygons. (line 6) * red: Setting commands. (line 6) * reflection <1>: Segments. (line 6) * reflection <2>: Circles. (line 6) * reflection <3>: Lines. (line 6) * reflection <4>: Conics. (line 6) * reflection: Points. (line 6) * right <1>: Triangles. (line 6) * right <2>: Interactive assignments. (line 6) * right: Drawing commands. (line 6) * rotation <1>: Circles. (line 6) * rotation <2>: Lines. (line 6) * rotation <3>: Vectors. (line 10) * rotation <4>: Segments. (line 6) * rotation <5>: Points. (line 6) * rotation: Conics. (line 6) * round: Numbers. (line 13) * segment: Segments. (line 6) * sign: Numbers. (line 13) * simple: Drawing commands. (line 6) * sin: Numbers. (line 13) * sqrt: Numbers. (line 13) * square: Polygons. (line 6) * strokes: Setting commands. (line 6) * style: Setting commands. (line 6) * tan: Numbers. (line 13) * thickness: Setting commands. (line 6) * trace: Trace commands. (line 6) * translation <1>: Conics. (line 6) * translation <2>: Segments. (line 6) * translation <3>: Points. (line 6) * translation <4>: Lines. (line 6) * translation: Circles. (line 6) * triangle: Triangles. (line 6) * tricks: Setting commands. (line 6) * triple: Drawing commands. (line 6) * up: Interactive assignments. (line 6) * vector: Vectors. (line 10) * vertices: Conics. (line 44) * white: Setting commands. (line 6) * yellow: Setting commands. (line 6)  Tag Table: Node: Top213 Node: Tutorial1104 Node: Drawing a triangle1446 Node: More about triangles3511 Node: A property of parallelograms5382 Node: The theorem of Thales6274 Node: Reference8702 Node: Syntax9141 Node: Numbers10938 Node: Vectors13737 Node: Points14414 Node: Lines16286 Node: Segments17820 Node: Circles18616 Node: Conics19407 Node: Triangles20851 Node: Polygons23480 Node: Interactive assignments25478 Node: Setting commands26784 Node: Drawing commands28874 Node: Trace commands33800 Node: PSTricks34685 Node: Options35799 Node: Parameters36599 Node: Caveats37128 Node: Export commands37720 Node: Samples38118 Node: Incircle and bisectors38710 Node: Feuerbach circle39039 Node: Isosceles triangle39591 Node: Collinear points40069 Node: Angles in a parallelogram40404 Node: Addition of vectors40744 Node: Tangents to a circle41130 Node: A spiral41560 Node: A parabola with focus and directrix41791 Node: Contact42093 Node: Concept index42391 Node: Command index51614  End Tag Table