[R] vectors cross-product V1 x V2

Bai bailhcn at gmail.com
Fri Jul 8 08:27:53 CEST 2011


Hi, everyone,

I need an efficient way to do vectors cross product in R.

Set vectors,
V1 = ai + bj + ck
V2 = di + ej + fk

then the cross product is
  V1 x V2    =  (bf - ce) i + (cd - af) j + (ae - bd) k


As shown here ( http://en.wikipedia.org/wiki/Cross_product ).

Thanks.

Best,
Bai



More information about the R-help mailing list