That is if they have length 1 as is the case here. Normalize them to length 1, if not.
On Tue, Sep 1, 2009 at 11:06 AM, Gabor Grothendieck<ggrothendi...@gmail.com> wrote: > Since the inner product of two vectors if the cos of the > angle between them: > >> A <- c(0,1); O <- c(0,0); B <- c(1,0) >> acos((A-O) %*% (B-O)) * 180 / pi > [,1] > [1,] 90 > > > On Tue, Sep 1, 2009 at 9:08 AM, > clair.crossup...@googlemail.com<clair.crossup...@googlemail.com> > wrote: >> Dear all, >> >> I was doing some self study and was wondering if a function already >> exists which allows one to determine the angle between points. e.g. >> given the following (x,y) coordinates >> >> input: (0,1); (0,0); (1,0) >> >> would result in: >> >> output: 90 degrees >> >> Best regards >> C.C. > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.