def rotation3d(x=0, y=0, z=0):
 cos_x = cos(x)
 cos_y = cos(y)
 cos_z = cos(z)
 sin_x = sin(x)
 sin_y = sin(y)
 sin_z = sin(z)
 r = np.array([[(cos_y * cos_z), (((- cos_x) * sin_z) + ((sin_x * sin_y) * cos_z)), ((sin_x * sin_z) + ((cos_x * sin_y) * cos_z))], [(cos_y * sin_z), ((cos_x * cos_z) + ((sin_x * sin_y) * sin_z)), (((- sin_x) * cos_z) + ((cos_x * sin_y) * sin_z))], [(- sin_y), (sin_x * cos_y), (cos_x * cos_y)]], dtype=float)
 return r

def rotation3d ( x = 0 , y = 0 , z = 0 ) : cos_x = cos ( x ) cos_y = cos ( y ) cos_z = cos ( z ) sin_x = sin ( x ) sin_y = sin ( y ) sin_z = sin ( z ) r = np . array ( [ [ ( cos_y * cos_z ) , ( ( ( - cos_x ) * sin_z ) + ( ( sin_x * sin_y ) * cos_z ) ) , ( ( sin_x * sin_z ) + ( ( cos_x * sin_y ) * cos_z ) ) ] , [ ( cos_y * sin_z ) , ( ( cos_x * cos_z ) + ( ( sin_x * sin_y ) * sin_z ) ) , ( ( ( - sin_x ) * cos_z ) + ( ( cos_x * sin_y ) * sin_z ) ) ] , [ ( - sin_y ) , ( sin_x * cos_y ) , ( cos_x * cos_y ) ] ] , dtype = float ) return r
create an array with a 3 dimensional rotation matrix .