Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
{
"title": "CROSS_PRODUCT",
"language": "en"
}
---

## Description

Computes the cross product of two arrays of size 3.

## Syntax

```sql
CROSS_PRODUCT(<array1>, <array2>)
```

## Parameters

| Parameter | Description |
| -- |--|
| `<array1>` | The first vector, the subtype of the input array supports: TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, the number of elements must be consistent with array2. Neither the array itself nor any of its elements can be NULL.|
| `<array1>` | The second vector, the subtype of the input array supports: TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, the number of elements must be consistent with array1. Neither the array itself nor any of its elements can be NULL.|

## Return Value

Returns the cross product of two arrays of size 3.

## Examples

```sql
SELECT CROSS_PRODUCT([1, 2, 3], [2, 3, 4]), CROSS_PRODUCT([1, 0, 0], [0, 1, 0]);
```

```text
+-------------------------------------+-------------------------------------+
| CROSS_PRODUCT([1, 2, 3], [2, 3, 4]) | CROSS_PRODUCT([1, 0, 0], [0, 1, 0]) |
+-------------------------------------+-------------------------------------+
| [-1, 2, -1] | [0, 0, 1] |
+-------------------------------------+-------------------------------------+
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
{
"title": "CROSS_PRODUCT",
"language": "zh-CN"
}
---

## 描述

计算两个三维向量的叉积

## 语法

```sql
CROSS_PRODUCT(<array1>, <array2>)
```

## 参数

| 参数 | 说明 |
| -- |--|
| `<array1>` | 第一个向量,输入数组的子类型支持:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE,元素数量需与 array2 保持一致,数组本身与数组元素均不允许为NULL|
| `<array2>` | 第二个向量,输入数组的子类型支持:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE,元素数量需与 array1 保持一致,数组本身与数组元素均不允许为NULL|

## 返回值

返回两个三维向量的叉积。

## 举例

```sql
SELECT CROSS_PRODUCT([1, 2, 3], [2, 3, 4]), CROSS_PRODUCT([1, 0, 0], [0, 1, 0]);
```

```text
+-------------------------------------+-------------------------------------+
| CROSS_PRODUCT([1, 2, 3], [2, 3, 4]) | CROSS_PRODUCT([1, 0, 0], [0, 1, 0]) |
+-------------------------------------+-------------------------------------+
| [-1, 2, -1] | [0, 0, 1] |
+-------------------------------------+-------------------------------------+
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
{
"title": "CROSS_PRODUCT",
"language": "zh-CN"
}
---

## 描述

计算两个三维向量的叉积

## 语法

```sql
CROSS_PRODUCT(<array1>, <array2>)
```

## 参数

| 参数 | 说明 |
| -- |--|
| `<array1>` | 第一个向量,输入数组的子类型支持:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE,元素数量需与 array2 保持一致,数组本身与数组元素均不允许为NULL|
| `<array2>` | 第二个向量,输入数组的子类型支持:TINYINT、SMALLINT、INT、BIGINT、LARGEINT、FLOAT、DOUBLE,元素数量需与 array1 保持一致,数组本身与数组元素均不允许为NULL|

## 返回值

返回两个三维向量的叉积。

## 举例

```sql
SELECT CROSS_PRODUCT([1, 2, 3], [2, 3, 4]), CROSS_PRODUCT([1, 0, 0], [0, 1, 0]);
```

```text
+-------------------------------------+-------------------------------------+
| CROSS_PRODUCT([1, 2, 3], [2, 3, 4]) | CROSS_PRODUCT([1, 0, 0], [0, 1, 0]) |
+-------------------------------------+-------------------------------------+
| [-1, 2, -1] | [0, 0, 1] |
+-------------------------------------+-------------------------------------+
```
1 change: 1 addition & 0 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1553,6 +1553,7 @@ const sidebars: SidebarsConfig = {
'sql-manual/sql-functions/scalar-functions/array-functions/array-contains',
'sql-manual/sql-functions/scalar-functions/array-functions/array-contains_all',
'sql-manual/sql-functions/scalar-functions/array-functions/array-count',
'sql-manual/sql-functions/scalar-functions/array-functions/array-cross-product',
'sql-manual/sql-functions/scalar-functions/array-functions/array-cum-sum',
'sql-manual/sql-functions/scalar-functions/array-functions/array-difference',
'sql-manual/sql-functions/scalar-functions/array-functions/array-distinct',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
{
"title": "CROSS_PRODUCT",
"language": "en"
}
---

## Description

Computes the cross product of two arrays of size 3.

## Syntax

```sql
CROSS_PRODUCT(<array1>, <array2>)
```

## Parameters

| Parameter | Description |
| -- |--|
| `<array1>` | The first vector, the subtype of the input array supports: TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, the number of elements must be consistent with array2. Neither the array itself nor any of its elements can be NULL.|
| `<array1>` | The second vector, the subtype of the input array supports: TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, the number of elements must be consistent with array1. Neither the array itself nor any of its elements can be NULL.|

## Return Value

Returns the cross product of two arrays of size 3.

## Examples

```sql
SELECT CROSS_PRODUCT([1, 2, 3], [2, 3, 4]), CROSS_PRODUCT([1, 0, 0], [0, 1, 0]);
```

```text
+-------------------------------------+-------------------------------------+
| CROSS_PRODUCT([1, 2, 3], [2, 3, 4]) | CROSS_PRODUCT([1, 0, 0], [0, 1, 0]) |
+-------------------------------------+-------------------------------------+
| [-1, 2, -1] | [0, 0, 1] |
+-------------------------------------+-------------------------------------+
```

1 change: 1 addition & 0 deletions versioned_sidebars/version-4.x-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@
"sql-manual/sql-functions/scalar-functions/array-functions/array-contains",
"sql-manual/sql-functions/scalar-functions/array-functions/array-contains_all",
"sql-manual/sql-functions/scalar-functions/array-functions/array-count",
"sql-manual/sql-functions/scalar-functions/array-functions/array-cross-product",
"sql-manual/sql-functions/scalar-functions/array-functions/array-cum-sum",
"sql-manual/sql-functions/scalar-functions/array-functions/array-difference",
"sql-manual/sql-functions/scalar-functions/array-functions/array-distinct",
Expand Down