Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package compute;
- public class point{
- public double x, y;
- public int id;
- public point(int id, double x, double y) {
- this.x = x;
- this.y = y;
- this.id = id;
- }
- public point(point p) {
- this(p.id, p.x, p.y);
- }
- public static double dist(point a, point b){
- return Math.sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
- }
- @Override
- public String toString(){
- return "point("+id+")=["+x+", "+y+"]";
- }
- }
Add Comment
Please, Sign In to add comment