0
votes

I have three vectors a, b, c in cartesian coordinate system x, y, z. Vectors are expressed in 3*3 matrix form by their components on x, y, z coordinates.

Virtual cube is created from vectors a, b, c which starts at same point.

I want to calculate angle between a vector in x,y,z coordinate and a plane inside virtual cube.

Angle between line and plane is found if plane normal is known. But I can't get normal of plane inside a cube.

1

1 Answers

1
votes

If you mean the plane that contains a, b, and c, then the plane's normal can be calculated with the cross product:

n = (b - a) x (c - a)

You may want to normalize this vector afterwards. Make sure that your angle calculation is orientation-invariant, i.e. take the absolute value of the dot product.

angle = acos(abs(dot(v, n)) / (norm(n) * norm(v))