Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class Vertex {
  2. double x;
  3. double y;
  4.  
  5. public Vertex (double x,double y){
  6. this.x = x;
  7. this.y = y;
  8.  
  9. }
  10.  
  11. public String toString(){
  12. return "x:"+this.x+"y:"+this.y;
  13. }
  14.  
  15. public void moveTo (Vertex b){
  16. this.x += b.x;
  17. this.y += b.y;
  18. }
  19. public void setTo (Vertex b){
  20. this.x = b.x;
  21. this.y = b.y;
  22.  
  23. }
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement