Android examples for Graphics:Rectangle
Calculates the height of a rectangle given the left and right edges and an aspect ratio.
//package com.java2s; public class Main { /**/*from w ww . j a v a 2s . c om*/ * Calculates the height of a rectangle given the left and right edges and * an aspect ratio. */ public static float calculateHeight(float left, float right, float targetAspectRatio) { final float width = right - left; final float height = width / targetAspectRatio; return height; } }