Java tutorial
//package com.java2s; import android.graphics.Rect; public class Main { public static float calculateAspectRatio(float paramFloat1, float paramFloat2, float paramFloat3, float paramFloat4) { return (paramFloat3 - paramFloat1) / (paramFloat4 - paramFloat2); } public static float calculateAspectRatio(Rect paramRect) { return paramRect.width() / paramRect.height(); } }