Learn R Programming

DescTools (version 0.99.56)

CrossN: n-dimensional Vector Cross Product

Description

Vector cross product of n-1 vectors in n-dimensional space

Usage

CrossN(A)

Value

a vector of length n

Arguments

A

matrix of size (n-1) x n where n >= 2.

Author

Hans W. Borchers <hwborchers@googlemail.com>

Details

The rows of the matrix A are taken as(n-1) vectors in n-dimensional space. The cross product generates a vector in this space that is orthogonal to all these rows in A and its length is the volume of the geometric hypercube spanned by the vectors.

See Also

Cross, Dot

Examples

Run this code
A <- matrix(c(1,0,0, 0,1,0), nrow=2, ncol=3, byrow=TRUE)
CrossN(A)  #=> 0 0 1

x <- c(1.0, 0.0, 0.0)
y <- c(1.0, 0.5, 0.0)
z <- c(0.0, 0.0, 1.0)
identical(Dot(x, CrossN(rbind(y, z))), det(rbind(x, y, z)))

Run the code above in your browser using DataLab