Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ptRotatePt2f问题 #53

Open
zglinghunan opened this issue Dec 25, 2023 · 2 comments
Open

ptRotatePt2f问题 #53

zglinghunan opened this issue Dec 25, 2023 · 2 comments

Comments

@zglinghunan
Copy link

请教一下,这个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;

没想明白,请指点

@DennisLiu1993
Copy link
Owner

@zglinghunan
Copy link
Author

谢谢您的回复。平常的旋转我能理解,但为什么要用dy1,dy2?
(dY1 - ptOrg.y) * sin(dAngle)
(dY1 - ptOrg.y) * cos(dAngle)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants