topical media & game development

talk show tell print

graphic-processing-algorithm-Ch03-p76-MySegment.pde / pde



  class MySegment {
    MyPoint start; // members of class
    MyPoint end;
    //Constructor
    public MySegment(MyPoint p1, MyPoint p2){
      start = new MyPoint(p1.x, p1.y);
      end = new MyPoint(p2.x, p2.y);
    }
    //Move
    public void move(float xoff, float yoff){
      start.move(xoff, yoff);
      end.move(xoff, yoff);
    }
    //plot
    public void plot(){
      line(start.x, start.y, end.x, end.y);
    }
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.