diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-04-18 06:03:19 +0400 |
commit | dfe2f8dc03267e041102837e92f547fb04881510 (patch) | |
tree | d9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /source/blender/python/doc/examples/mathutils.py | |
parent | d7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff) | |
parent | 00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff) |
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'source/blender/python/doc/examples/mathutils.py')
-rw-r--r-- | source/blender/python/doc/examples/mathutils.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/python/doc/examples/mathutils.py b/source/blender/python/doc/examples/mathutils.py new file mode 100644 index 00000000000..dee8fa4d6bd --- /dev/null +++ b/source/blender/python/doc/examples/mathutils.py @@ -0,0 +1,17 @@ +import mathutils + +vec = mathutils.Vector(1.0, 2.0, 3.0) + +mat_rot = mathutils.RotationMatrix(90, 4, 'X') +mat_trans = mathutils.TranslationMatrix(vec) + +mat = mat_trans * mat_rot +mat.invert() + +mat3 = mat.rotation_part() +quat1 = mat.to_quat() +quat2 = mat3.to_quat() + +angle = quat1.difference(quat2) + +print(angle)
\ No newline at end of file |