public class Point { /* insert your name here */ /* * The Point class is used to identify a point in 2D space. * A point has a X coordinate and a Y coordinate. */ private double x; private double y; private final double epsilon = 10e-6; /** * * pre: none * post: the x value of the point is returned */ public double getx(){ System.out.println("getx not implemented yet"); return 0.0; } /** pre: none * post: the x value of the point is set * The return value is set to true if the value is updated * * For this method, "this.x" refers to the instance variable of * the object needed here to disambiguate from the parameter "x" */ public boolean setx(double x){ System.out.println("setX not implemented yet"); return false; } /** * *pre: None *post: The y value of a point is returned */ public double gety(){ System.out.println("getY not implemented yet"); return 0.0; } /** pre: none * post: the y value of the point is set * The return value is set to true if the value is updated * * For this method, "this.y" refers to the instance variable of * the object needed here to disambiguate from the parameter "y" */ public boolean sety(double y){ System.out.println("setY not implemented yet"); return false; } /** * pre: x and y set to valid points on the x and y axis * post: a Point is created with the x and y values set to * the incoming parameters. * */ public Point(double x, double y){ System.out.println("Point(x,y) not implemented yet"); } /** * pre: none * post: Point created at the origin * * * origin created by Point(), use this to call the general Point constructor */ public Point(){ System.out.println("Point() not implemented yet"); } /** * pre: none * post: String in the form (x,y) is returned * * A point object is represented by a string in the following format: * (x,y). A point whose x value is 2.0 and y value is -1.0 would be represented * by the following: * (2.0,-1.0) * */ public String toString(){ System.out.println("toString not implemented yet"); return ""; } /** * pre: p is set to a valid point * post: true or false returned, true if the x and y values of this point * are within epsilon of the x and y values of the argument * * This is test for equality using epsilon, because we * are dealing with doubles,so roundoff can occur */ public boolean equals (Point p){ System.out.println("equals not implemented yet"); return false; } /** * * pre: a valid Point * post: The Euclidean distance from this point to the argument point * p is returned * * Euclidean distance of this point to point p is defined as the square root * of the sum of the distances squared. Calculate the distance of (x-x') and * (y-y'), square each and add them together. The Euclidean distance is * the square root of this value. */ public double euclidDist(Point p){ System.out.println("euclidDist not implemented yet"); return 0.0; } /** * @param args: no args */ public static void main(String[] args) { // TODO test harness for Point // test all methods /* * Place your test cases here */ } }