/* * points */ package funwithpoints; /** * * @author Sean */ public class Point { private int x; private int y; public void set_x(int userGivenX){ x = userGivenX; } public void set_y(int userGivenY){ y = userGivenY; } public int get_x(){ return x; } public int get_y(){ return y; } public double calculateDistanceFrom(Point somePoint){ //x^2 double xSquared = Math.pow(x - somePoint.get_x(), 2); //y^2 double ySquared = Math.pow(y - somePoint.get_y(), 2); double hyp = ( xSquared + ySquared); return Math.sqrt( hyp ); } }