Documentation

    array_cross_product

    Computes the cross product of two arrays of size 3. The array elements can not be NULL.

    Try an expression

    In Formula, enter the expression and set Output type to VARCHAR.

    Expression

    array_cross_product(array_value(1.0::FLOAT, 2.0::FLOAT, 3.0::FLOAT), array_value(2.0::FLOAT, 3.0::FLOAT, 4.0::FLOAT))

    Result

    '[-1.0, 2.0, -1.0]'

    The expression returns FLOAT[3]. Formula stores it as VARCHAR in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

    Arguments and types

    array_cross_product(array, array)
    array
    List
    Supported signatures (2)
    array_cross_product(array: DOUBLE[3], array: DOUBLE[3]) → DOUBLE[3]
    array_cross_product(array: FLOAT[3], array: FLOAT[3]) → FLOAT[3]

    The result type can depend on the input types. See DuckDB for the full argument rules.

    Things to know

    If the first argument is missing, the result is NULL.

    Browse lists & arraysDuckDB documentation

    Function metadata from DuckDB, used under the MIT license.