class TriangleVerticesCalculator {

    public float[] getAspectRatioVerticesData(int widthIn, int heightIn, int widthOut, int heightOut) {
        System.arraycopy(defaultTriangleVerticesData, 0, triangleVerticesData, 0, defaultTriangleVerticesData.length);

        float aspectRatioIn = (float) widthIn / heightIn;
        float heightOutCalculated = (float) widthOut / aspectRatioIn;

        if (heightOutCalculated < heightOut) {
            float deltaHeight = (heightOut - heightOutCalculated) / heightOut;
            GetMinMax vertical = new GetMinMax(1).invoke();
            triangleVerticesData[vertical.getMin1()] += deltaHeight;
            triangleVerticesData[vertical.getMin2()] += deltaHeight;
            triangleVerticesData[vertical.getMax1()] -= deltaHeight;
            triangleVerticesData[vertical.getMax2()] -= deltaHeight;
        } else {
            float deltaWidth = (widthOut - heightOut * aspectRatioIn) / widthOut;
            GetMinMax horizontal = new GetMinMax(0).invoke();
            triangleVerticesData[horizontal.getMin1()] += deltaWidth;
            triangleVerticesData[horizontal.getMin2()] += deltaWidth;
            triangleVerticesData[horizontal.getMax1()] -= deltaWidth;
            triangleVerticesData[horizontal.getMax2()] -= deltaWidth;
        }

        return triangleVerticesData;
    }

    public  TriangleVerticesCalculator();
    public  TriangleVerticesCalculator(float[] triangleVerticesData);

}