# ars/lib/pydispatch/dispatcher.py

weak references to receivers, and thus must be de-

referenced on retrieval to retrieve the callable

connections -- { senderkey (id) : { signal : [receivers...]}}

senders -- { senderkey (id) : weakref(sender) }

used for cleaning up sender references on sender

sendersBack -- { receiverkey (id) : [senderkey (id)...] }

used for cleaning up receiver references on receiver

deletion, (considerably speeds up the cleanup process

# ars/lib/pydispatch/saferef.py

key -- the identity key for the reference, calculated

by the class's calculateKey method applied to the

deletionMethods -- sequence of callable objects taking

single argument, a reference to this object which

will be called when *either* the target object or

target function is garbage collected (i.e. when

this object becomes invalid). These are specified

as the onDelete parameters of safeRef calls.

weakSelf -- weak reference to the target object

weakFunc -- weak reference to the target function

def rot_matrix_to_euler_angles(rot_matrix):

"""Returns the 3-1-3 Euler angles `phi`, `theta` and `psi` (using the

- x-convention) corresponding to the rotation matrix ~~`~~`rot_matrix`~~`~~, which

+ x-convention) corresponding to the rotation matrix `rot_matrix`, which

is a tuple of three 3-element tuples, where each one is a row (what is

Using the x-convention, the 3-1-3 Euler angles `phi`, `theta` and `psi`

- (around the Z, X and again the Z-axis) can be obtained as follows

+ (around the Z, X and again the Z-axis) can be obtained as follows::

phi = arctan2(A_{31}, A_{32})

psi = -arctan2(A_{13}, A_{23})

- http://en.wikipedia.org/wiki/Rotation_representation_(mathematics)#

- Rotation_matrix_.E2.86.94_Euler_angles

+ http://en.wikipedia.org/wiki/Rotation_representation_(mathematics)%23Rotation_matrix_.E2.86.94_Euler_angles

# ars/utils/mathematical.py

return matrix_as_3x3_tuples(tuple(result.flatten()))

def matrix_as_tuple(matrix_):

- """matrix_: nested tuples, e.g. ((1,0),(1,1),(2,5))"""

+ """\matrix_: nested tuples, e.g. ((1,0),(1,1),(2,5))"""

return gut.nested_iterable_to_tuple(matrix_)