fork(1) download
  1. aspect_ratio = 17.0 / 7.0
  2. image_width = 400
  3.  
  4. image_height = int(image_width / aspect_ratio)
  5.  
  6. viewport_height = 2
  7. viewport_width = viewport_height * image_width / image_height
  8.  
  9. print("Aspect ratio:", aspect_ratio)
  10. print("Image:", image_width, "x", image_height)
  11. print("Viewport:", viewport_width, "x", viewport_height)
  12.  
Success #stdin #stdout 0.04s 9592KB
stdin
Standard input is empty
stdout
Aspect ratio: 2.4285714285714284
Image: 400 x 164
Viewport: 4.878048780487805 x 2