Here you can find the source of dx(Point a, Point b)
public static int dx(Point a, Point b)
//package com.java2s; //License from project: Apache License import java.awt.Point; public class Main { public static int dx(Point a, Point b) { return Math.abs(a.x - b.x); }// w w w .ja v a 2 s . com }