Guest User

Untitled

a guest
Jan 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. package Homework_02PointLine;
  2.  
  3. public final class Line {
  4. private final Point start;
  5. private final Point end;
  6.  
  7. public Line(Point start, Point end) {
  8. this.start = start.clone();
  9. this.end = end.clone();
  10. }
  11.  
  12. public double getLength() {
  13. return Math.sqrt(Math.pow(start.getX() - end.getX(), 2) + Math.pow(start.getY() - end.getY(), 2));
  14. }
  15. }
Add Comment
Please, Sign In to add comment