Tag:java the ball from 100 meters height free fall
/** * Title: A ball from 100 meters height of the free fall, each landing back to the original height of half, and then down, to ask it to fall on the 10th time, the total number of meters? How high is the 10th time rebound? * Time: July 28, 2015 15:34:18 * file: Lianxi10.java * cutter_point */package bishi.zuixin50.t2015728;public class Lianxi10 {// This is a geometric series public static double Getan (double begin, double n) {//The height of the rebound when the nth landing is obtained, that is, the height of the 11th time//similar to geometric series a:n = a:1/POW (2, n-1) dou Ble pow = math.pow (2.0, n); return begin/pow;} Calculate the distance/** * Geometric series sum * @param begin the place where the ball begins to fall * @param q We ratio * @param n number * @return */public static double GetLength (do Uble begin, double Q, double n) {//our formula is S:n = (a:1 * (1-q (n-th)))/(1-Q)//The formula here is S:n = 0.5 * s:n-1 + 150== "s:n =-((10 0)/pow (2, n-2)) + 300//This song sn is: (3*n + 1/(2: (n-2))-4) Double length = begin * (3-MATH.POW (q, N-2)); return length;} public static void Main (string[] args) {System.out.println ("the height of the 10th bounce is:" + getan (100, 10)); System.out.println ("The Distance traveled is:" + getlength (1, 0.5, ten));d ouble h = 100,s = 100;for (int i = +; I < ++i) {s + = H;h/= 2;} System.out.println ("After the journey:" + s); System.out.println ("Bounce Height:"+ H/2);}}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
"Written test" 10, a ball from the height of 100 meters free fall, to find relevant data