Adding Rotation to a Vector

Digging up my old post here but if I can accurately get both of these extents (blue debug spheres) no matter what the rotation, what sort of equation do I need to work out the circled areas? TiA