vectorproduct: Vector product

View source: R/vectorproduct.R

vectorproductR Documentation

Vector product

Description

Computes the vector (cross) product of two three-dimensional vectors. The inputs may be individual vectors or matrices whose rows represent vectors.

Usage

vectorproduct(x, y, normalize = FALSE)

Arguments

x, y

Numeric vectors of length three or matrices with three columns. If a matrix is supplied, each row is interpreted as a vector.

normalize

Logical flag indicating whether the resulting vector(s) should be normalized to unit length.

Value

Returns either a 3-element vector or an n\times3 matrix containing the row-wise vector products.

See Also

scalarproduct, vectornorm, unitvector


cooltools documentation built on Sept. 11, 2026, 5:06 p.m.