setCartesian 函数 #

创建两个(多)集合的笛卡尔积。多维数组将被转换为一维数组,并在操作前按升序排序。

Syntax #

math.setCartesian(set1, set2)

Parameters #

Parameter Type Description
a1 Array | Matrix 一个(多)集合
a2 Array | Matrix 一个(多)集合

Returns #

Type Description
Array | Matrix 两个(多)集合的笛卡尔积

Throws #

Type | Description —- | ———–

Examples #

math.setCartesian([1, 2], [3, 4])        // returns [[1, 3], [1, 4], [2, 3], [2, 4]]
math.setCartesian([4, 3], [2, 1])        // returns [[3, 1], [3, 2], [4, 1], [4, 2]]

另请参阅 #

setUnion, setIntersect, setDifference, setPowerset

Fork me on GitHub