function rotateRect (rect, angle, origin) {
    const tl = rotatePoint({ x: rect.x, y: rect.y }, angle, origin)
    const tr = rotatePoint({ x: rect.x + rect.width, y: rect.y }, angle, origin)
    const br = rotatePoint({ x: rect.x + rect.width, y: rect.y + rect.height }, angle, origin)
    const bl = rotatePoint({ x: rect.x, y: rect.y + rect.height }, angle, origin)

    const minx = Math.min(tl.x, tr.x, bl.x, br.x)
    const maxx = Math.max(tl.x, tr.x, bl.x, br.x)
    const miny = Math.min(tl.y, tr.y, bl.y, br.y)
    const maxy = Math.max(tl.y, tr.y, bl.y, br.y)

    return {
      x: minx,
      y: miny,
      width: (maxx - minx),
      height: (maxy - miny)
    }
  }
@param {module:utilities.BBoxObject} rect
@param {Float} angle
@param {module:math.XYObject} origin
@returns {module:utilities.BBoxObject}