3 ms·
> If you give me a vector `A` and a vector `B`, and I return to you `C=A×B`, on the "syntax" level, A, B, and C look the same. Here you go: A = <1.0, 2.0, 3
by a1369209993 6y ago
> If you give me a vector `A` and a vector `B`, and I return to you `C=A×B`, on the "syntax" level, A, B, and C look the same.
Here you go:
A = <1.0, 2.0, 3.0, 4.0>
B = <5.0, 6.0, 7.0, 8.0>
What exactly is A×B supposed to look like there? :)
Cross product is awful. The wedge product, on the other hand, is:
# C = <<Ax*By-Ay*Bx,Ax*Bz-Az*Bx,Ax*Bt-At*Bx,
Ay*Bz-Az*By,Ay*Bt-At*By,Az*Bt-At*Bz>>
# C = <<1*6-2*5,1*7-3*5,1*8-4*5,2*7-3*6,2*8-4*6,3*8-4*7>>
# C = <<6-10,7-15,8-20,14-18,16-24,24-28>>
C = <<-4.0,-8.0,-12.0,-4.0,-8.0,-4.0>>
Which works fine for any number of dimensions. (Assuming coordinate-lexicographic order (resonable) and that I didn't screw up the arithmetic (less so).)
- MiroF 6y agoWell if you think of the cross product as returning a single vector that is orthogonal to all the others, then your question "what is AxB" for $\mathbb{R}^4$ seems ill-specified. You would instead need to do CrossProduct(A, B, C) and calculate the determinant of the 4x4 matrix with the last row being the $\mathbb{R}^4$ basis. You could also create a function by lazy evaluation of CrossProduct(A, B) : $\mathbb{R}^4 \rightarrow \mathbb{R}^4$
- a1369209993 6y ago> "what is AxB" for $\mathbb{R}^4$ seems ill-specified. Thats also true for R^3: does <1,0,0>x<0,1,0> give <0,0,1>, or <0,0,-1>?
- MiroF 6y agothe determinant of the matrix {{1,0,0},{0,1,0},{e_1,e_2,e_3}} is e_3 so <0,0,1>. it's completely specified by the order of A and B - there are two possible orders and two possible vectors.
- a1369209993 6y agoIt's not specified at all because there is no such matrix - the e_i are vectors, not scalars. At best it's a convenient mnemonic abbreviation for something decided on some other basis; that's like saying that the gradient is 'specified' by the 'vector' ∇ = <∂/∂x,∂/∂y,∂/∂z>.