Next: Quadrilaterals, Previous: Intersections [Contents][Index]

### 3.3 Triangles

Triangular assignments consist in a list of three variable names followed by either `triangle`, `right`, `isosceles` or `equilateral`, and some optional parameters.

Example: `A B C triangle 6, 5, 4, 0°`

In the following, we will use letter x for the first side of the triangle, i.e. the segment joining the first and the second vertices, y for the second side, i.e. the segment joining the second and the third vertices, and z for the third side. Likewise, we will use letter u for the first angle, v for the second angle, and a for the direction of the first side.

In a triangular assignment one or two vertices may be predefined, i.e. the first or the first and the second variables already contain points. If no vertices are predefined then the first variable is set to the origin of the implicit coordinate system. The direction of the first side is horizontal unless specified by an angular value at the end of the parameter list. If two vertices are predefined then the parameters giving the length and the orientation of the first side have to be omitted.

If no parameter is given, the length of the first side is set to 6.

#### Generic triangles

`triangle { x { , a } }`
`triangle { x, } y, z { , a }`
`triangle { x, } u, v { , a }`
`triangle { x, } u, z { , a }`
`triangle { x, } z, v { , a }`

The first assignment yields an optimal scalene triangle.

#### Right triangles

`right { x { , a } }`
`right { x, } y { , a }`
`right { x, } u { , a }`

With these assignments the resulting triangle has a right angle at its second vertex. The first assignment yields a right triangle with sides proportional to 4-3-5.

#### Isosceles triangles

`isosceles { x { , a } }`
`isosceles { x, } y { , a }`
`isosceles { x, } u { , a }`

With these assignments the resulting triangle is isosceles at its third vertex. The first assignment yields a golden triangle.

#### Equilateral triangles

`equilateral { x { , a } }`

#### Triangle related functions

`angle(A, B, C)`

  Degree measure of angle ABC.

`height(A, B, C)`

  Height of triangle ABC with respect to vertex A.

`orthocenter(A, B, C)`

  Orthocenter of triangle ABC.

`altitude(A, B, C)`

  Altitude of triangle ABC with respect to vertex A.

`bisector(A, B, C)`

  Bisector of angle ABC.

`median(A, B, C)`

  Median of triangle ABC with respect to vertex A.

`circle(A, B, C)`

  Circumcircle of triangle ABC.

`incircle(A, B, C)`

  Incircle of triangle ABC.

Next: Quadrilaterals, Previous: Intersections [Contents][Index]