Here I coded some part of what you want and I think you continue with this:

CPaintDC dc(this);

CPoint pt11( 10, 10 );

CPoint pt12( 100, 100 );

CPoint pt21( 10, 60 );

CPoint pt22( 100, 150 );

dc.MoveTo( pt11 );

dc.LineTo( pt12 );

dc.MoveTo( pt21 );

dc.LineTo( pt22 );

float m = (float)(pt12.y - pt11.y) / (float)(pt12.x - pt11.y);

float alpha = ::atanf( m );

float palpha = alpha + (3.14159f/2.0f);

CPoint basePt;

basePt.x = (pt12.x - pt11.x) / 2;

basePt.y = (pt12.y - pt11.y) / 2;

CPoint pbasePt;

int len = 50;

pbasePt.x = basePt.x + (int)(len * ::cos( palpha ));

pbasePt.y = basePt.y + (int)(len * ::sin( palpha ));

dc.MoveTo( basePt );

dc.LineTo( pbasePt );

CPaintDC dc(this);

CPoint pt11( 10, 10 );

CPoint pt12( 100, 100 );

CPoint pt21( 10, 60 );

CPoint pt22( 100, 150 );

dc.MoveTo( pt11 );

dc.LineTo( pt12 );

dc.MoveTo( pt21 );

dc.LineTo( pt22 );

float m = (float)(pt12.y - pt11.y) / (float)(pt12.x - pt11.y);

float alpha = ::atanf( m );

float palpha = alpha + (3.14159f/2.0f);

CPoint basePt;

basePt.x = (pt12.x - pt11.x) / 2;

basePt.y = (pt12.y - pt11.y) / 2;

CPoint pbasePt;

int len = 50;

pbasePt.x = basePt.x + (int)(len * ::cos( palpha ));

pbasePt.y = basePt.y + (int)(len * ::sin( palpha ));

dc.MoveTo( basePt );

dc.LineTo( pbasePt );