@Test
public void testScaleHorizontallyThenVertically() {

    int inWidth = 10;
    int inheight = 5;
    int outWidth = 20;
    int outheight = 5;
    TriangleVerticesCalculator calculator = new TriangleVerticesCalculator();
    float scale [] = calculator.getScale_PreserveAspectFit(0, inWidth, inheight, outWidth, outheight);
    assertAlmostEqual(scale, new float[] {0.5f, 1f}, 1e-7);
    inWidth = 10;
    inheight = 5;
    outWidth = 5;
    outheight = 20;
    scale = calculator.getScale_PreserveAspectFit(0, inWidth, inheight, outWidth, outheight);
    assertAlmostEqual(scale, new float[] {1f, 0.125f}, 1e-7);
}