Module Mathutils :: Class Quaternion
[frames | no frames]

Class Quaternion


The Quaternion object

This object gives access to Quaternions in Blender.
Method Summary
New quaternion object. __init__(list, angle)
Create a new quaternion object from initialized values.
  conjugate()
Set the quaternion to it's conjugate.
  identity()
Set the quaternion to the identity quaternion.
  inverse()
Set the quaternion to it's inverse
  negate()
Set the quaternion to it's negative.
  normalize()
Normalize the quaternion.
Euler object toEuler()
Return Euler representation of the quaternion.
Matrix object toMatrix()
Return a matrix representation of the quaternion.

Class Variable Summary
  angle: A scalar representing the amount of rotation in degrees.
  axis: Vector representing the axis of rotation.
  magnitude: The magnitude of the quaternion.
  w: The w value.
  x: The x value.
  y: The y value.
  z: The z value.

Method Details

__init__(list, angle=None)
(Constructor)

Create a new quaternion object from initialized values.

Example:
 quat = Mathutils.Quaternion([1.0,0.0,0.0])
Parameters:
list - A 3d or 4d list to initialize quaternion. 4d if intializing [w,x,y,z], 3d if used as an axis of rotation.
           (type=PyList of int/float)
angle - An arbitrary rotation amount around 'list'. List is used as an axis of rotation in this case.
           (type=float (optional))
Returns:
It depends wheter a parameter was passed:
  • (list/angle): Quaternion object initialized with the given values;
  • (): An identity 4 dimensional quaternion.

           (type=New quaternion object.)

conjugate()

Set the quaternion to it's conjugate.

identity()

Set the quaternion to the identity quaternion.

inverse()

Set the quaternion to it's inverse

negate()

Set the quaternion to it's negative.

normalize()

Normalize the quaternion.

toEuler()

Return Euler representation of the quaternion.
Returns:
Euler representation of the quaternion.
           (type=Euler object)

toMatrix()

Return a matrix representation of the quaternion.
Returns:
A rotation matrix representation of the quaternion.
           (type=Matrix object)

Class Variable Details

angle

A scalar representing the amount of rotation in degrees.

axis

Vector representing the axis of rotation.

magnitude

The magnitude of the quaternion.

w

The w value.

x

The x value.

y

The y value.

z

The z value.

Generated by Epydoc 2.1 on Mon Jun 13 15:31:22 2005 http://epydoc.sf.net