setIntersect.md (912B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 2 3 # Function setIntersect 4 5 Create the intersection of two (multi)sets. 6 Multi-dimension arrays will be converted to single-dimension arrays before the operation. 7 8 9 ## Syntax 10 11 ```js 12 math.setIntersect(set1, set2) 13 ``` 14 15 ### Parameters 16 17 Parameter | Type | Description 18 --------- | ---- | ----------- 19 `a1` | Array | Matrix | A (multi)set 20 `a2` | Array | Matrix | A (multi)set 21 22 ### Returns 23 24 Type | Description 25 ---- | ----------- 26 Array | Matrix | The intersection of two (multi)sets 27 28 29 ### Throws 30 31 Type | Description 32 ---- | ----------- 33 34 35 ## Examples 36 37 ```js 38 math.setIntersect([1, 2, 3, 4], [3, 4, 5, 6]) // returns [3, 4] 39 math.setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]]) // returns [3, 4] 40 ``` 41 42 43 ## See also 44 45 [setUnion](setUnion.md), 46 [setDifference](setDifference.md)