R/make_unit_vector.R
make_unit_vector.Rd
Create a unit vector from a given vector
make_unit_vector(x)
Vector of length 3.
A normalized unit vector of length 3
make_unit_vector(c(3, 4, 0)) #> [1] 0.6 0.8 0.0 make_unit_vector(c(1, 1, 1)) #> [1] 0.5773503 0.5773503 0.5773503