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

Can you explain the operation in the function rotateImage? #14

Open
DRjy opened this issue Nov 3, 2022 · 0 comments
Open

Can you explain the operation in the function rotateImage? #14

DRjy opened this issue Nov 3, 2022 · 0 comments

Comments

@DRjy
Copy link

DRjy commented Nov 3, 2022

scale_h = (h / cos + (w - h * tan) * sin) / h

scale_w = (h / sin + (w - h / tan) * cos) / w

scale = max(scale_h, scale_w)

Hi, thanks your great work. I have a trobule in understanding the operation of rotation.
I dont derive the new_height and new_width, and do not understand why the maximum of max(scale_h, scale_w) as the final scale? Can you give me a detailed explanation?

Thank you @qianqianwang68 in advance!

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

1 participant