Checking if an object in the plane is a rhombus: is_rhombus

### 13.16.9 Checking if an object in the plane is a rhombus: is_rhombus

See Section 14.13.13 for checking for rhombuses in three-dimensional geometry.

The is_rhombus command determines whether or not a geometric object is a rhombus.

- is_rhombus takes one argument:
  G, a geometric object or a sequence of four points assumed to be the vertices of a quadrilateral.
- is_square(G) returns 1 if G is a rhombus but not a square, returns 2 if G is a square and returns 0 otherwise.

Examples.

- Input:
  is_rhombus(1+i, -1+i, -1-i, 1-i)
  Output:

  1

- Input:

  K:= rhombus(1+i, -1+i, pi/4)
  is_rhombus(K)

  Output:

  1

- Input:

  K:= rhombus(1+i, -1+i, pi/4, C, D)
  is_rhombus(K[0])

  Output:

  1

  Note that K[0] is a rhombus since K is a list made of a rhombus and vertices C and D.
  Input:
  affix(C,D)
  Output:

  − | √ |
  2
  | −i, − | √ |
  2
  | +i

- Input:
  is_rhombus(i, -1+i, -1-i, 1-i)
  Output:

  0