ptRotatePt2f问题
zglinghunan opened this issue · 2 comments
zglinghunan commented
请教一下,这个ptRotatePt2f函数中,是计算图像旋转后坐上角顶点的坐标?
为什么要用:
double dY1 = dHeight - ptInput.y, dY2 = dHeight - ptOrg.y;
double dX = (ptInput.x - ptOrg.x) * cos(dAngle) - (dY1 - ptOrg.y) * sin(dAngle) + ptOrg.x;
double dY = (ptInput.x - ptOrg.x) * sin(dAngle) + (dY1 - ptOrg.y) * cos(dAngle) + dY2;
没想明白,请指点
zglinghunan commented
谢谢您的回复。平常的旋转我能理解,但为什么要用dy1,dy2?
(dY1 - ptOrg.y) * sin(dAngle)
(dY1 - ptOrg.y) * cos(dAngle)