Last active
          August 29, 2015 14:04 
        
      - 
      
- 
        Save jitensachdeva/f1c04c389d2c593c6795 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class Line { private: | |
| bool changed; double length; Point start; Point end; | |
| public: | |
| void setStart(Point p) { start = p; changed = true; } | |
| void setEnd(Point p) Point getStart(void) | |
| Point getEnd(void) | |
| double getLength() { if (changed) { | |
| { end = p; changed = true; } { return start; } | |
| { return end; } | |
| length = start.distanceTo(end); | |
| changed = false; | |
| } | |
| return length; } | |
| }; | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment