distance between two JavaFX Point2D - Java javafx.geometry

Java examples for javafx.geometry:Point2D

Description

distance between two JavaFX Point2D

Demo Code


//package com.java2s;

import javafx.geometry.Point2D;

public class Main {
    public static double distance(Point2D a, Point2D b) {
        return Math.sqrt((a.getX() - b.getX()) * (a.getX() - b.getX())
                + (a.getY() - b.getY()) * (a.getY() - b.getY()));
    }/*from w ww. j  a v a 2  s  .  co m*/
}

Related Tutorials