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