CodePudding user response:
The vector cross triple product in 3D is
p = a×(b×c)
The full expansion can be computed with the following matrix/vector product
|px| | -ay*by-az*bz ay*bx az*bx | | cx |
|py| = | ax*by -ax*bx-az*bz az*by | | cy |
|pz| | ax*bx ay*bz -ax*bx-ay*by | | cz |
There are multiple 2D projections of the above depending if none, one or two of the vectors a, b or c are out of plane (with a z component non-zero).
In your case all three vectors are in plane (az=0
, bz=0
and cz=0
) which yields the following result
|px| | -ay*by ay*bx 0 | | cx | | ay*(bx*cy-by*cx) |
|py| = | ax*by -ax*bx 0 | | cy | = | ax*(by*cx-bx*cy) |
| 0| | 0 0 -ax*bx-ay*by | | 0 | | 0 |
So there you have it. The right-hand side of the above is the result of a×(b×c) in 2D.