Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algorithm
- In: d, w:h
- Out: w, h
- 1) arctan(h/w)=theta
- 2) w = d*cos(theta)
- 3) h = d*sin(theta)
- "Test"
- In: d=30 , 16:9
- 1) arctan(9/16)= 29.36 degrees
- 2) w = 30 * cos(29.36) = 26.1
- 3) h = 30 * sin(29.36) = 14.7
- Out: w = 26.1 , h = 14.7
Advertisement
Add Comment
Please, Sign In to add comment