Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.PointF;

public class Main {
    /**
     * Find the distance between two points.
     * 
     * @param one
     * @param two
     * @return the distance between point one and two
     */
    private static float getDistanceBetweenTwoPoints(PointF one, PointF two) {
        float dx = one.x - two.x; // horizontal difference
        float dy = one.y - two.y; // vertical difference
        float dist = (float) Math.sqrt(dx * dx + dy * dy);

        return dist;
    }
}