Skip to contents

Makes vectors normalized and orthogonal to each other.

Usage

vector3_ortho_normalize(v1, v2)

Arguments

v1

A numeric vector of length 3.

v2

A numeric vector of length 3.

Value

A list with elements v1 and v2, both numeric vectors of length 3.

Examples

result <- vector3_ortho_normalize(c(1, 0, 0), c(0, 1, 0))
result$v1
#> x y z 
#> 1 0 0 
result$v2
#> x y z 
#> 0 1 0