API for rotating display

Greetings,

Recently I want to make a application that is capable of rotating my external display. I found these related APIs CGBeginDisplayConfiguration, CGDisplayRotation.

The first one let me change height and width of display, but not the rotation angle, and the second one only shows the current rotation angle.

I wonder is it possible for us to change the rotation of display someway through API?

Thank you, Kuroame