# Checking if an object in space is a parallelogram: is_parallelogram

### 14.13.14 Checking if an object in space is a parallelogram: is_parallelogram

See Section 13.16.10 for checking for parallelograms in two-dimensional geometry.

The is_parallelogram command determines whether or not an object is a parallelogram.

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

#### Examples.

- Input:
  is_parallelogram([0,0,0],[2,0,0],[3,1,0],[1,1,0])
  Output:

  1

- Input:
  is_parallelogram([-1,0,0],[0,1,0],[2,0,0],[0,-1,0])
  Output:

  0

- Input:

  P:= parallelogram([0,0,0],[2,0,0],[1,1,0])
  is_parallelogram(P)

  Output:

  1

- Note that
  Input:
  P:= parallelogram([0,0,0],[2,0,0],[1,1,0],D)
  defines P to be a list consisting of the parallelogram and the point D; to test if the object is a parallelogram, the first component of P needs to be tested.
  Input:
  is_parallelogram(P[0])
  Output:

  1

- Input:
  is_parallelogram([-1,0,0],[0,1,0],[2,0,0],[0,-1,0])
  Output:

  0