Closed RobinHankin closed 7 months ago
bug verified:
library("stokes")
vector_cross_product(cbind(c(3,4,2),c(7,8,9)))
#> [1] 20 -13 -4
vector_cross_product(cbind(6,7))
#> Error in vector_cross_product(cbind(6, 7)): n == ncol(M) + 1 is not TRUE
Created on 2024-01-29 with reprex v2.1.0
Glenn Davies makes some observations:
In package
stokes
,vector_cross_product()
fails in the trivial case $n=2$. In this case, the "product" is just a unary operator, and rotates the single 2-vector counterclockwise by $\pi/2$. But the fix is easy --just adddrop=FALSE
to get:det( M[-i, ,drop=FALSE] )
.There is a typo In the man page, where you write: "However, the vector cross product may easily be generalized to a product of (n-1)-tuples of vectors in R^3". The '3' should be 'n'.
In the vignette, you might mention that the Wikipedia authors call this product the "external product". But this is rare and very easily confused with "exterior product", so I prefer Spivak's "cross product".