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