Exemplo n.º 1
0
    def rotate_fixed_axis(self,fromframe,axis,q,system = None):
        system = system or pynamics.get_system()

        rotation = Rotation.build_fixed_axis(fromframe,self,axis,q,system)
        rotational_velocity = RotationalVelocity.build_fixed_axis(fromframe,self,axis,q,system)
        self.add_rotation(rotation)
        self.add_w(rotational_velocity)
        fromframe.add_rotation(rotation)
        fromframe.add_w(rotational_velocity)
        fromframe.R_tree.add_branch(self.R_tree)        
        fromframe.w_tree.add_branch(self.w_tree)        
Exemplo n.º 2
0
    def rotate_fixed_axis(self, fromframe, axis, q, system):
        import pynamics.misc_tools
        if not all([pynamics.misc_tools.is_literal(item) for item in axis]):
            raise (Exception('not all axis variables are constant'))

        rotation = Rotation.build_fixed_axis(fromframe, self, axis, q, system)
        rotational_velocity = RotationalVelocity.build_fixed_axis(
            fromframe, self, axis, q, system)
        self.set_parent_generic(fromframe, rotation, 'R')
        self.set_parent_generic(fromframe, rotational_velocity, 'w')
        self.add_generic(rotation, 'R')
        self.add_generic(rotational_velocity, 'w')
        fromframe.add_generic(rotation, 'R')
        fromframe.add_generic(rotational_velocity, 'w')

        fromframe.tree['R'].add_branch(self.tree['R'])
        fromframe.tree['w'].add_branch(self.tree['w'])