Formula to calculate middle point - Android java.lang

Android examples for java.lang:Math Formula

Description

Formula to calculate middle point

Demo Code


//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;
    }
}

Related Tutorials