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°.



Go to: Tutorial index Previous page Next page Concept index Command index