texture coordinate rotation angel

Have you a minute for me?

I am interesting in Cesium project, especially in kml-branch

so, I found that some tags (for example LatLonQuad) wasn’t implement in it. Because I need this tag , I try to implement it. After a moment I catch a problem about that: my pictures in polygon are inclined, so I need to compute rotation angel to texture Coordinates.

So, that is became big problem. I convert Cartographic coordinates to Cartesian3 and build bounding rectangle to find distances and compute this angel, but computation were wrong. Also I try to compute angel between inclined and bounding rectangle using Cartesian3.angelBetweem - but it also wrong.

what is my best decision to do that?

Thanks in advance,

Kate

Sorry. I cant help you out.

But for others to help I think its easier if you show your progress/code and where things goes wrong. Just a general advice.

so. but maybe you know. my aim is to get rotation angle from 4 coordinates. How can I do that?

I add an image. it is two 256*256 image. but as you can see, they are wrong aligned. what should I change?