Angle between two shape elements

Dear all,

In the attachment, Green and Red elements represents the two different shape elements. I need to get the angle between them. Is there any inbuilt method available?