R: Vector Cross Product

Cross {DescTools} | R Documentation

## Vector Cross Product

### Description

Vector or cross product

### Usage

      Cross(x, y)

### Arguments

`x` | numeric vector or matrix
`y` | numeric vector or matrix

### Details

Computes the cross (or: vector) product of vectors in 3 dimensions. In case of matrices it takes the first dimension of length 3 and computes the cross product between corresponding columns or rows.

The more general cross product of `n-1` vectors in n-dimensional space is realized as `CrossN`.

### Value

3-dim. vector if `x` and `<` are vectors, a matrix of 3-dim. vectors if `x` and `y` are matrices themselves.

### Author(s)

Hans W. Borchers <hwborchers@googlemail.com>

### See Also

`Dot`, `CrossN`

### Examples

    Cross(c(1, 2, 3), c(4, 5, 6))  # -3  6 -3

    # Triple product can be calculated as:
    va <- c(1, 2, 3)
    vb <- c(4, 3, 0)
    vc <- c(5, 1, 1)

    Dot(va, Cross(vb, vc))

[Package DescTools version 0.99.35 Index]