vert <- matrix(c(0, 0, 10, 10), nrow = 2, ncol = 2,
byrow = TRUE, dimnames = list(c("1", "2"), c("x", "y")))
vect <- data.frame(cbind(x = c(1, -2, -3), y = c(-1, 2, -3), z = c(-1, 1, -1)))
tran.vector(vert, vect, 20)
## magn long arrow.x arrow.y
## [1,] 1.732051 -1.414214 2.809440e-16 -4.588315
## [2,] 3.000000 2.828427 -1.299754e-15 4.588315
## [3,] 4.358899 0.000000 -1.946657e+01 -4.588315Run the code above in your browser using DataLab