I have 3d line(unit direction vector) which allways originate in (0,0,0) and 3d vector which allways points in one of two directions(negative or positive) on this 3d line.
The question is how do I check on which side my vector is ?
I have 3d line(unit direction vector) which allways originate in (0,0,0) and 3d vector
Share
Your unit vector is of form (x,y,z) and your other vector is of form (a,b,c).
It’s now enough to find any component x,y,z that is not zero and test that the corresponding component in a,b,c has the same sign. If it does, they are on the same side.
The operation of ‘dot product’ does this automatically:
if (a*x + b*y + c*z) >0 the vectors are on the same side.