Reputation: 321
I use a struct to represent the direction like this:
struct POINT{
double x;
double y;
double z;
}
Given the B(Bx,By,Bz)
and I(Ix,Iy,Iz)
. How to determine the F?
Upvotes: 2
Views: 444
Reputation: 10756
Your question is actually what is the algorithm for a 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);
Upvotes: 6