Computes the cross product of \(n-1\) vectors of length \(n\).

cross(...)

x %cross% y

Arguments

...

\(n-1\) vectors of length \(n\).

x

numeric or character vector of length 3.

y

numeric or character vector of length 3.

Value

\(n\)-dimensional vector orthogonal to the \(n-1\) vectors.

Functions

  • %cross%: binary operator for 3-dimensional cross products.

References

Guidotti, E. (2020). "calculus: High dimensional numerical and symbolic calculus in R". https://arxiv.org/abs/2101.00086

Examples

### canonical basis 4-d cross(c(1,0,0,0), c(0,1,0,0), c(0,0,0,1))
#> [1] 0 0 1 0
### canonical basis 3-d cross(c(1,0,0), c(0,1,0))
#> [1] 0 0 1
### symbolic cross product 3-d c(1,0,0) %cross% c(0,1,0)
#> [1] 0 0 1
### symbolic cross product 3-d c("a","b","c") %cross% c(0,0,1)
#> [1] "((b)*((1))) * 1" "((a)*((1))) * -1" "0"