Checking whether an object is an equilateral triangle in the plane

### 25.15.5 Checking whether an object is an equilateral triangle in the plane

See Section 26.11.9 for checking for equilateral triangles in three-dimensional geometry.

The is_equilateral command determines whether or not a geometric object is an equilateral triangle.

- is_equilateral takes G, a geometric object or a sequence of three points assumed to be the vertices of a triangle.
- is_equilateral(G) returns 1 if the object is an equilateral triangle and returns 0 otherwise.

#### Examples

is_equilateral(0,2,1+i*sqrt(3))

1 |  |  |  |  |  |  |  |  |  |

T:=equilateral_triangle(0,2,C); is_equilateral(T[0])

1 |  |  |  |  |  |  |  |  |  |

Note that T[0] is a triangle since T is a list made of a triangle and the vertex C.

affix(C)

| √ |
3
| i+1

is_equilateral(1+i,-1+i,-1-i)

0 |  |  |  |  |  |  |  |  |  |