math_cross_product: Compute Vector Cross Product

math_cross_productR Documentation

Compute Vector Cross Product

Description

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.

Usage

math_cross_product(x, y)

Arguments

x

numeric vector or matrix

y

numeric vector or matrix

Details

The cross product of two vectors is the perpendicular vector to the plane spanned by the given vectors x and y.

https://en.wikipedia.org/wiki/Cross_product

Value

A scalar or vector of length the number of columns of x and y.

Author(s)

Florian Wagner florian.wagner@wagnius.ch

See Also

<math_dot_product>

Examples

math_cross_product(c(1,0,0), c(0,1,0))
math_dot_product(c(1,0),c(0,1))
math_dot_product(c(1,0),c(-1,0))

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.