You need to know what adding two vectors together does and how a vector rotation works.
Since you want the mesh to be the center of the rotation, the vector from the pivot mesh to the rotating object has a constant length. This vector is the offset vector because the rotating object is offset from the pivot object. By rotating this vector you will also rotate the relative position of the rotating object.
Since you want the height to be the same, just make the original offset vector have a zeroed out Z component.