# intersect() Function & Examples

Use the intersect() geometry function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## intersect

#### intersect(expr1, expr2, expr3, expr4)

#### intersect(expr1, expr2, expr3)

Try it yourself:

```calculio
intersect([0, 0], [10, 10], [10, 0], [0, 10])
intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])
```

---

## intersect(): retain shared values

**intersect(a, b)** returns values that occur in both collections. It is useful for comparing tags, allowed options, IDs, or candidate lists.

## Example

The intersection of `[1, 2, 3]` and `[2, 3, 4]` is `[2, 3]`. The precise treatment of duplicates and ordering follows the calculator’s collection rules, so do not assume it is a multiset operation without testing representative input.

## Set-style workflows

Use [setUnion()](https://calcul.io/function/setUnion/index.md) to combine unique values, [setDifference()](https://calcul.io/function/setDifference/index.md) to find values excluded by another list, and [setIsSubset()](https://calcul.io/function/setIsSubset/index.md) to test one membership. [compare()](https://calcul.io/function/compare/index.md) helps establish an ordering before presentation.

## Input caution

Compare compatible item types. Text case, floating-point approximations, and nested objects can make values that look alike fail equality checks.

[All functions](https://calcul.io/functions/index.md)
