# Direction of cross product between two vectors when theta>pi

I have two 3D vectors, v1 and v2, that lay in the same plane in a 3D space. When calculating the cross product between them to find the normal to the plane, the right-hand rule applies for the direction of the resulting vector in the range of theta = 0...pi (considering that the angle is always counter-clockwise). However, when the angle between the two vectors is theta > pi, the direction swaps. This is a problem when I don't know the angle, and calculating the angle is not trivial. How can I prevent this, or fix the direction of the cross product for the whole range 0...2pi?

• There is a direct formula for the cross product of two vectors if you know their components. Is that what you need? Dec 3, 2016 at 15:35
• Calculating the angle is, relatively speaking, very easy. What constraint do you have that makes it hard? Dec 3, 2016 at 16:19
• Thanks for the response. I want to calculate the real angle, as in always counter-clockwise (as in my comment just added below). In order to do that I need the normal to the plane (as shown here link). But how can I calculate the normal to the plane by having only the two vectors given without knowing the "real"/CCW angle, such that the direction of the normal doesn't change regardless on whether the angle is smaller or larger than pi? Dec 3, 2016 at 16:30
• There’s nothing intrinsic to the two vectors that you can use. The “real” angle you want—equivalently, which way is “up” for the plane of the vectors—can only be defined relative to some external reference. Try finding a concrete definition for why you would say that the angle between two vectors is $\gt pi$.
– amd
Dec 3, 2016 at 21:23
• Thank you, amd. I guess there's no nice way to make this calculation more general than having that external reference. I'll think about it and see what I can do. Dec 4, 2016 at 4:43

The right-hand rule still applies to $[-\pi,0]$ as well, if you interpret the angle between $\pi$ and $2\pi$ instead as an angle between $-\pi$ and $0$.
Maybe you should be content with the range $[-\pi,\pi]$ instead.
• Thanks for the response. The problem is that I don't know the real angle or the sign of the angle. Say, I have a vector v1 = (1,0,0) and a vector v2 = (0,0,1). The angle between the two is 1/2pi and v1 x v2 = (0,-1,0). If v2 changes to v2 = (0,0,-1), the calculated angle is still 1/2pi, but the actual CCW angle is 3/2pi, and the cross product now changes the direction to v1 x v2 = (0,1,0). How can I get the same cross product for both cases? Dec 3, 2016 at 16:26