Learn R Programming

CHAT (version 1.1)

getCosine: Computes cosine value of the angle for two vectors.

Description

This function implements the Law of Cosines to compute the cosine value of two vectors on BAF-LRR plot.

Usage

getCosine(v1, v2)

Arguments

v1
numeric vector
v2
numeric vector

Value

numeric cosine value

Examples

Run this code
## See what happens to vectors with 45 degree angle
v1=c(1,1)
v2=c(1,0)
getCosine(v1,v2)

Run the code above in your browser using DataLab