title: How to calculate the aspect ratio by a given factor?
body: <p>How do I calculate the aspect ratio (formatted as <code>integer:integer</code>) by a given factor?</p>
  
  <p>For example, aspect ratio 16:9 has a factor of 1.778, because 16 / 9 = 1.778. But how can I find the ratio by that factor? So</p>
  
  <pre><code>Dimension getAspectRatio(double factor) {
      ...
  }
  
  public static void main(String[] arguments) {
      Dimension d = getAspectRatio(16d / 9d);
      System.out.println(d.width + ":" + d.height);
  }
  </code></pre>
  
  <p>should return</p>
  
  <pre><code>16:9
  </code></pre>