3
$\begingroup$
a = Vector((1,2,3))
b = Vector((4,3,2))

print(a.angle(b))

I'm trying to calculate two vectors' angle between them using Vector_1.angle(Vector_2), but output is None. What kind of format it should be?

enter image description here

$\endgroup$
7
  • $\begingroup$ It is not None, it print 0.6533257961273193 in my console $\endgroup$
    – X Y
    Jul 1, 2022 at 12:48
  • $\begingroup$ Why we different @X Y $\endgroup$
    – P. Scotty
    Jul 1, 2022 at 12:53
  • $\begingroup$ Does it make a difference if you run in the blender text editor? $\endgroup$
    – X Y
    Jul 1, 2022 at 12:59
  • $\begingroup$ Oh it work! Maybe there are some mistake in jupyter? $\endgroup$
    – P. Scotty
    Jul 1, 2022 at 13:06
  • $\begingroup$ no idea, I use Visual Studio Code. $\endgroup$
    – X Y
    Jul 1, 2022 at 13:46

1 Answer 1

3
$\begingroup$

The output is not None. It is 0.6533257961273193. Try again use this code:

import bpy
from mathutils import *

a = Vector((1,2,3))
b = Vector((4,3,2))

print(a.angle(b))
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .