I presume these are two rectangle shapes, here is a way you can center them:
- Draw a line parallel to the side of one of the rectangles
- Select one of the rectangles, press Ctrl-T to show the handles and the center point
- Drag the rectangle to snap its center on the line
- Repeat steps 2 and 3 for the second rectangle
- Delete the line you drew in step one.
If these are rectangles rotated after drawing you may be better off doing the alignment while they are in their original position then selecting both layers and rotating them with the aid of free transform, Ctrl-T. Here is a screen capture to show the operation in progress.