Beispiel #1
0
    def __init__(self,
                 xmin=None,
                 xmax=None,
                 ymin=None,
                 ymax=None,
                 pos=None,
                 vel=(0, 0),
                 mass=None,
                 density=None,
                 bbox=None,
                 shape=None,
                 rect=None,
                 **kwds):

        # Define as propriedades das caixas de contorno
        xmin, xmax, ymin, ymax = aabb_bbox(bbox=bbox,
                                           rect=rect,
                                           shape=shape,
                                           pos=pos,
                                           xmin=xmin,
                                           xmax=xmax,
                                           ymin=ymin,
                                           ymax=ymax)

        pos = ((xmin + xmax) / 2., (ymin + ymax) / 2.)
        self._delta_x = dx = (xmax - xmin) / 2
        self._delta_y = dy = (ymax - ymin) / 2
        self.cbb_radius = sqrt(dx**2 + dy**2)
        aabb = _AABB(xmin, xmax, ymin, ymax)
        super(AABB, self).__init__(pos,
                                   vel,
                                   mass=mass,
                                   density=density,
                                   baseshape=aabb,
                                   **kwds)
Beispiel #2
0
    def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None,
                 pos=None, vel=(0, 0), mass=None, density=None,
                 bbox=None, shape=None, rect=None, **kwds):

        # Define as propriedades das caixas de contorno
        xmin, xmax, ymin, ymax = aabb_bbox(bbox=bbox, rect=rect,
                                           shape=shape, pos=pos,
                                           xmin=xmin, xmax=xmax,
                                           ymin=ymin, ymax=ymax)

        pos = ((xmin + xmax) / 2., (ymin + ymax) / 2.)
        self._delta_x = dx = (xmax - xmin) / 2
        self._delta_y = dy = (ymax - ymin) / 2
        self.cbb_radius = sqrt(dx ** 2 + dy ** 2)
        super(AABB, self).__init__(pos, vel,
                                   mass=mass, density=density, **kwds)
Beispiel #3
0
    def ROG(self):
        '''Retorna o raio de giração'''

        return sqrt(self.ROG_sqr())
Beispiel #4
0
    def ROG(self):
        '''Retorna o raio de giração'''

        return sqrt(self.ROG_sqr())
Beispiel #5
0
    def ROG(self):
        '''Retorna o raio de giração do círculo'''

        return self.cbb_radius / sqrt(2)
Beispiel #6
0
    def ROG(self):
        '''Retorna o raio de giração do círculo'''

        return self._radius / sqrt(2)