def rotate2d(self, ang=0.0, sc=True): """rotate( ang:float - angle of rotation (degrees) sc:bool - reference system for rotation (body or system coordinates) ). Function that rotates the 2D object of an angle ang. If sc = False the rotation is made wrt the body coordinates, wrt the system coordinates otherwise. """ if sc: self.obj = ocaml.body_rotated_sc(self.obj,0,1,ang) else: self.obj = ocaml.body_rotated_bc(self.obj,0,1,ang)
def rotate(self, a1_ix, a2_ix, ang=0.0, sc=True): """rotate( a1_ix:int - index of first rotation axis a2_ix:int - index of second rotation axis ang:float - angle of rotation (degrees) sc:bool - reference system for rotation (body or system coordinates) ). Function that rotates the object of an angle ang given the indices of the rotation axes. If sc = False the rotation is made wrt the body coordinates, wrt the system coordinates otherwise. """ if sc: self.obj = ocaml.body_rotated_sc(self.obj,a1_ix,a2_ix,ang) else: self.obj = ocaml.body_rotated_bc(self.obj,a1_ix,a2_ix,ang)
def z_rotation(): # 2D & 3D if bc: return ocaml.body_rotated_bc(obj,1,0,ang) else: return ocaml.body_rotated_sc(obj,1,0,ang)
def y_rotation(): # only 3D if bc: return ocaml.body_rotated_bc(obj,0,2,ang) else: return ocaml.body_rotated_sc(obj,0,2,ang)