package main; public class Point { private int x; private int xMin; private int y; private int yMin; public Point() { this.x = 0; this.y = 0; } public Point(int x, int y) { this.x = x; this.xMin = 0; this.y = y; this.yMin = 0; } public Point(int x, int xMin, int y, int yMin) { this.x = x; this.xMin = xMin; this.y = y; this.yMin = yMin; } public Point(Point p) { this.x = p.x; this.xMin = p.xMin; this.y = p.y; this.yMin = p.yMin; } public int getX() { return this.x; } public int getXMin() { return this.xMin; } public int getY() { return this.y; } public int getYMin() { return this.yMin; } public void setX(int x) { this.x = x; } public void setXMin(int xMin) { this.xMin = xMin; } public void setY(int y) { this.y = y; } public void setYMin(int yMin) { this.yMin = yMin; } public boolean equals(Point p) { return (this.x == p.x && this.y == p.y && this.xMin == p.xMin && this.yMin == p.yMin); } public String toString() { return String.valueOf(this.x) + "," + this.y; } public static int xDif(Point p1, Point p2) { return 100 * (p2.x - p1.x) + p2.xMin - p1.xMin; } public static int yDif(Point p1, Point p2) { return 100 * (p2.y - p1.y) + p2.yMin - p1.yMin; } public static double dist(Point p1, Point p2) { return Math.sqrt(Math.pow((p1.x + p1.xMin / 100 - p2.x - p2.xMin / 100), 2.0D) + Math.pow((p1.y + p1.yMin / 100 - p2.y - p2.yMin / 100), 2.0D)); } }