HOW TO CONSTRUCT SEGMÈNT

Hello,
Please help me solve the following task:

We have a segment S1 of length X. It is drawn with Corel's standard toolkit
How to construct a perpendicular S2 to its center with length Y
I am asking for 2 VBA solutions - one where the segments form a T shape and another where they form an X shape.

Greetings!