コード例 #1
0
ファイル: mesh_objects.py プロジェクト: fangohr/nmag-test
    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)  
コード例 #2
0
ファイル: mesh_objects.py プロジェクト: fangohr/nmag-test
    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)  
コード例 #3
0
ファイル: mesh_james1.py プロジェクト: fangohr/nmag-test
 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) 
コード例 #4
0
ファイル: mesh_james1.py プロジェクト: fangohr/nmag-test
 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)