Checking whether an object in the plane is an isosceles triangle

### 25.15.6 Checking whether an object in the plane is an isosceles triangle

See Section 26.11.10 for checking for isosceles triangles in three-dimensional geometry.

The is_isosceles command determines whether or not a geometric object is an isoceles triangle.

- is_isosceles takes G, a geometric object or a sequence of three points assumed to be the vertices of a triangle.
- is_isosceles(G) returns 1,2 or 3 if the object is an isoceles triangle (the number indicates which vertex is on two equal sides), returns 4 if the object is an equilateral triangle, and returns 0 otherwise.

#### Examples

is_isosceles(0,1+i,i)

2 |  |  |  |  |  |  |  |  |  |

T:=isosceles_triangle(0,1,pi/4); is_isosceles(T)

1 |  |  |  |  |  |  |  |  |  |

T:=isosceles_triangle(0,1,pi/4,C); is_isosceles(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)

√ |
2
2
| + |
√ |
2
2
| i

is_isosceles(1+i,-1+i,-i)

3 |  |  |  |  |  |  |  |  |  |

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

4 |  |  |  |  |  |  |  |  |  |