Android examples for java.lang:Math Geometry
Computes the aspect ratio of a given rect.
//package com.java2s; import android.graphics.RectF; public class Main { /**//from w ww .j a va2 s. co m * Computes the aspect ratio of a given rect. * @param rect the rect to have its aspect ratio computed. * @return the rect aspect ratio. */ public static float getRectRatio(RectF rect) { return rect.width() / rect.height(); } }