Le samedi 28 mars 2009 à 16:06 +0000, Wanja Mathar a écrit :
> Hi everyone,
> 
> i have a matrix of points and want to calculate the direction and length of 
> each vector between the points.
> 
> I can easily calculate the length with dist(testdata), but is their a 
> function that returns a matrix of the direction of the vectors between points 
> (angles 0-360°)?
> 
> testdata <- matrix(1:8, nrow=4, ncol=2,
>                 dimnames=list(c("A","B","C","D"), c("x","y"))

?atan2 ; ?outer

                                        Emmanuel Charpentier

______________________________________________
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.

Reply via email to