cprod: Computes the cross product of two vectors

Description Usage Arguments Details Value Author(s) Examples

View source: R/cprod.R

Description

Returns the cross product of two vectors using either the right-hand or left-hand convention.

Usage

1
cprod(u, v, h = "right")

Arguments

u

a vector of length 3

v

a vector of length 3

h

whether the right-hand, "right", or left-hand, "left", convention is to be used. The right-hand convention is default.

Details

The cross product vector is a vector orthogonal to the two input vectors.

Value

the cross product vector (also of length 3)

Author(s)

Aaron Olsen

Examples

1
2
3
4
5
6
## DEFINE TWO 3D VECTORS
u <- c(1, 0, 0)
v <- c(0, 1, 0)

## FIND THE CROSS PRODUCT
cprod(u, v)

linkR documentation built on May 2, 2019, 2:14 p.m.