package Geometry; public class Point { double x; double y; public double getX() { return this.x; } public double getY() { return this.y; } public Point() { this.x = 0; this.y = 0; } public Point(double x1, double y1) { this.x = x1; this.y = y1; } public double distance_from_origin() { double dist; dist = Math.sqrt(this.x*this.x + this.y*this.y); return dist; } public double distance_from_point(Point Q) { double diff_x = this.x - Q.x; double diff_y = this.y - Q.y; return Math.sqrt(diff_x*diff_x + diff_y*diff_y); } public void translate(double x_trans, double y_trans) { this.x = x+x_trans; this.y = y+y_trans; } public void x_MirrorImage() { this.y = -this.y; } public static Point Center(Point P, Point Q) { Point mid = new Point((P.x+Q.x)/2,(P.y+Q.y)/2); return mid; } public static Point Center(Point P, Point Q, Point R) { Point mid = new Point((P.x+Q.x+R.x)/3,(P.y+Q.y+R.y)/3); return mid; } }