calc_univec: Determine the unit vector of any input vector

View source: R/mathematicalfunctions.R

calc_univecR Documentation

Determine the unit vector of any input vector

Description

Determine the unit vector of any input vector

Usage

calc_univec(vector)

Arguments

vector

any vector or array with only one dimension

Value

the unit vector in the size of the input vector

Author(s)

Christina Harvey

Examples


 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)


AvInertia documentation built on March 24, 2022, 5:07 p.m.