View source: R/mathematicalfunctions.R
calc_univec | R Documentation |
Determine the unit vector of any input vector
calc_univec(vector)
vector |
any vector or array with only one dimension |
the unit vector in the size of the input vector
Christina Harvey
library(AvInertia) #any random input vector vector = c(1,2,3) output_vec = calc_univec(vector) # if unit vector the magnitude should = 1 pracma::Norm(output_vec)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.