Implemented functions to calculate direction vectors of bounding boxes