标签: c++ physics
我使用结构来表示这样的方向:
struct POINT{ double x; double y; double z; }
鉴于B(Bx,By,Bz)和I(Ix,Iy,Iz)。如何确定F?
B(Bx,By,Bz)
I(Ix,Iy,Iz)
答案 0 :(得分:6)
您的问题实际上是vector cross-product的算法是什么。
POINT F; F.x = (B.y * I.z) - (B.z * I.y); F.y = (B.z * I.x) - (B.x * I.z); F.z = (B.x * I.y) - (B.y * I.x);