Android examples for java.lang:Math Formula
Formula to calculate middle point
//package com.java2s; public class Main { private static double[] results = new double[2]; public static double[] midpoint(double x1, double x2, double y1, double y2) { results[0] = (x2 + x1) / 2;//from w w w . j av a 2 s .c o m results[1] = (y2 + y1) / 2; return results; } }