Guest User

Untitled

a guest
May 24th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. public double distance(Point p){
  2. if(p!=null){
  3. double dx=x-p.x;
  4. double dy=y-p.y;
  5. return Math.sqrt(dx*dx+dy*dy);
  6. }
  7. else
  8. throw new RuntimeException("p is null");
  9. }
Add Comment
Please, Sign In to add comment