Angle between two vectors 3D? python
<p>I am new in python.
I have two vectors in 3d space, and I want to know the angle between two</p>

<p>I tried:</p>

<pre><code>vec1=[x1,y1,z1]

vec2=[x2,y2,z2]

angle=np.arccos(np.dot(vec1,vec2)/(np.linalg.norm(vec1)*np.linalg.norm(vec2)))
</code></pre>

<p>but when change the order, vec2,vec1 obtain the same angle and no higher.
I want to give me a greater angle when the order of the vectors changes.</p>

<p>What you are asking is impossible as the plane that contains the angle can be oriented two ways and nothing in the input data gives a clue about it.</p>

<p>All you can do is to compute the smallest angle between the vectors (or its complement to 360Â°), and swapping the vectors can't have an effect.</p>

<p>The dot product isn't guilty here, this is a geometric dead-end.</p>

python python-2.7 numpy computational-geometry