Next / Previous / Contents / Shipman's homepage

11. Xrotate(): Create a rotation transform

The argument is the angle of rotation in radians.

homcoord.py
# - - -   X r o t a t e

def Xrotate(theta):
    '''Create a rotation transform.
    '''
    #-- 1 --
    sint = num.sin(theta)
    cost = num.cos(theta)

    #-- 2 --
    return Xform ( [ (cost, -sint, 0),
                     (sint, cost,  0),
                     (0,    0,     1) ] )