new function to compute oriented bbox