code: def as_poly(self, margin_width=0, margin_height=0):
          
          v_hor = (self.width/2 + margin_width)*np.array([np.cos(self.angle), np.sin(self.angle)])
          v_vert = (self.height/2 + margin_height)*np.array([-np.sin(self.angle), np.cos(self.angle)])
          c = np.array([self.cx, self.cy])
          return np.vstack([c - v_hor - v_vert, c + v_hor - v_vert, c + v_hor + v_vert, c - v_hor + v_vert])
docs: Converts this box to a polygon, i.e. 4x2 array, representing the four corners starting from lower left to upper left counterclockwise.
  
          :param margin_width: The additional "margin" that will be added to the box along its width dimension (from both sides) before conversion.
          :param margin_height: The additional "margin" that will be added to the box along its height dimension (from both sides) before conversion.
  
          >>> RotatedBox([0, 0], 4, 2, 0).as_poly()
          array([[-2., -1.],
                 [ 2., -1.],
                 [ 2.,  1.],
                 [-2.,  1.]])
          >>> RotatedBox([0, 0], 4, 2, np.pi/4).as_poly()
          array([[-0.707..., -2.121...],
                 [ 2.121...,  0.707...],
                 [ 0.707...,  2.121...],
                 [-2.121..., -0.707...]])
          >>> RotatedBox([0, 0], 4, 2, np.pi/2).as_poly()
          array([[ 1., -2.],
                 [ 1.,  2.],
                 [-1.,  2.],
                 [-1., -2.]])
          >>> RotatedBox([0, 0], 0, 0, np.pi/2).as_poly(2, 1)
          array([[ 1., -2.],
                 [ 1.,  2.],
                 [-1.,  2.],
                 [-1., -2.]])