5 ms·
I've never seen a cross product being defined in that way using Einstein notation. You might want to express the cross product using the Levi-Civita symbol eps
by QuantumRoar 12y ago
I've never seen a cross product being defined in that way using Einstein notation.
You might want to express the cross product using the Levi-Civita symbol epsilon_{ijk} [1].
epsilon_{ijk} = 1 for i,j,k = 1,2,3 and all even permutations thereof.
epsilon_{ijk} = -1 for all odd permutations of i,j,k = 1,2,3.
Else it is 0.
Then, the cross product reduces to:
C_i = epsilon_{ijk} A_j B_k
Using identities for epsilon_{ijk} you can – for example – easily calculate what A cross (B cross C) is.
[1]: https://en.wikipedia.org/wiki/Levi-Civita_symbol https://en.wikipedia.org/wiki/Levi-Civita_symbol
- JadeNB 12y ago> I've never seen a cross product being defined in that way using Einstein notation. In fact, I can't understand this use of the notation—namely, C_i = A_{i + 1 `mod` 3}B_{i + 2 `mod` 3} —and am not sure that it's correct. There is no free variable on the right-hand side, so I'm not sure over what to sum. Even if this were fixed, we'd need something like, as you say, the Levi–Civita symbol, since a given entry of the cross product is not a sum but a difference.
- QuantumRoar 12y agoOh, you're right. I just glanced over the equation and I thought I should recommend the standard notation. But as you stated, the cross product is clearly wrong as given by the author. There's obviously no other way than defining it with a totally antisymmetric quantity like the Levi-Civita symbol.
- hzhou321 12y agoWhen there is no free variable, there is no sum, just the loop. But you are right the the notion does not work as is because complicated subscript support is not implemented yet. But the equation is listed before the programming part is mentioned and it is an illustration of idea, so I believe it is ok. It is not difficult to add the implementation, although it will be tedious (but still behind the surface). It is matter of how useful it is. And you are probably right that implementing a Levi-Civita syntax might be more straight forward.
- hzhou321 12y agoOh I noticed my mistake, now corrected.