micher43

P1.9

Sep 18th, 2014
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. Algorithm
  2. In: d, w:h
  3. Out: w, h
  4.  
  5. 1) arctan(h/w)=theta
  6. 2) w = d*cos(theta)
  7. 3) h = d*sin(theta)
  8.  
  9. "Test"
  10. In: d=30 , 16:9
  11. 1) arctan(9/16)= 29.36 degrees
  12. 2) w = 30 * cos(29.36) = 26.1
  13. 3) h = 30 * sin(29.36) = 14.7
  14. Out: w = 26.1 , h = 14.7
Advertisement
Add Comment
Please, Sign In to add comment