Exemplo n.º 1
0
    def evolve_cython(self, dt):
        timestep = 0.00001
        nsteps = int(dt / timestep)

        r_i = np.array([[p.x, p.y] for p in self.particles])
        ang_speed_i = np.array([p.ang_speed for p in self.particles])

        c_evolve(r_i, ang_speed_i, timestep, nsteps)

        for i, p in enumerate(self.particles):
            p.x, p.y = r_i[i]
    def evolve_cython(self, dt):
        timestep = 0.00001
        nsteps = int(dt/timestep)
        
        r_i = np.array([[p.x, p.y] for p in self.particles])        
        ang_speed_i = np.array([p.ang_speed for p in self.particles])

        c_evolve(r_i, ang_speed_i, timestep, nsteps)
        
        for i, p in enumerate(self.particles):
            p.x, p.y = r_i[i]