# Relation

### Methods

#### (static) contain(shape1, shape2) → {boolean}

Returns true shape1's interior contains shape2
Same as inside(shape2, shape1)

Source:
  - algorithms/relation.js, line 98

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) cover(shape1, shape2) → {boolean}

Returns true shape1's cover shape2, same as shape2 covered by shape1

Source:
  - algorithms/relation.js, line 108

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) covered(shape1, shape2) → {boolean}

Returns true if every point in shape1 lies in the interior or on the boundary of shape2

Source:
  - algorithms/relation.js, line 87

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) disjoint(shape1, shape2) → {boolean}

Returns true if shapes have no points in common neither in interior nor in boundary

Source:
  - algorithms/relation.js, line 67

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) equal(shape1, shape2) → {boolean}

Returns true if shapes are topologically equal: their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other

Source:
  - algorithms/relation.js, line 37

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) inside(shape1, shape2) → {boolean}

Returns true shape1 lies in the interior of shape2

Source:
  - algorithms/relation.js, line 77

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) intersect(shape1, shape2) → {boolean}

Returns true if shapes have at least one point in common, same as "not disjoint"

Source:
  - algorithms/relation.js, line 47

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`

#### (static) relate(shape1, shape2) → {DE9IM}

Returns relation between two shapes as intersection 3x3 matrix, where each element contains relevant intersection as array of shapes. If there is no intersection, element contains empty array If intersection is irrelevant it left undefined. (For example, intersection between two exteriors is usually irrelevant)

Source:
  - algorithms/relation.js, line 122

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `DE9IM`

#### (static) touch(shape1, shape2) → {boolean}

Returns true if shapes have at least one point in common, but their interiors do not intersect

Source:
  - algorithms/relation.js, line 57

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape1` |  |
`shape2` |  |

##### Returns:

Type:
  `boolean`