vcosw: Cosine of the angle between two vectors

Description Usage Arguments Value Author(s) See Also Examples

Description

The function calculates the cosine of the angle between two vectors, defined as the inner product of the vectors divided by the product of their euclidean norms

Usage

1
vcosw(v, w)

Arguments

v

a vector

w

a vector, of the same length of v

Value

The cosine of the angle between the two vectors

Author(s)

Alessandro Barbiero, Giancarlo Manzi, Pier Alda Ferrari

See Also

Ferrari P.A., Annoni P., Barbiero A., Manzi G. (2011) An imputation method for categorical variables with application to nonlinear principal component analysis, Computational Statistics & Data Analysis, vol. 55, issue 7, pages 2410-2420, http://www.sciencedirect.com/science/article/pii/S0167947311000521

Examples

1
2
3
4
5
6
7
8
a<-1:10
b<-2:11
vcosw(a,b)
#
e<-c(1,2,3)
f<-c(3,-3,1)
vcosw(e,f)
# e and f are orthogonal vectors!

ForImp documentation built on May 2, 2019, 8:17 a.m.