calculate Mid Point for PointF - Android java.lang

Android examples for java.lang:Math Geometry

Description

calculate Mid Point for PointF

Demo Code


//package com.java2s;

import android.graphics.PointF;

public class Main {
    public static PointF calculateMidPoint(PointF start, PointF end) {
        PointF middle = new PointF();
        middle.set((start.x + end.x) / 2, (start.y + end.y) / 2);
        return middle;
    }//from www .  jav a2  s .  c  om
}

Related Tutorials