topical media & game development 
  
 
 
 
 
  
    
    
  
 graphic-processing-algorithm-Ch03-p76-p76.pde / pde
  MyPoint p1, p2, p3, p4; //define four points
  MySegment[] segment = new MySegment[2]; //define two segments
  MyShape shape; //define a shape
  //initialize variables
  void setup(){
    p1 = new MyPoint(10., 10.); //make a point
    p2 = new MyPoint(20., 20.); //make a point
    p3 = new MyPoint(20., 20.); //make a point
    p4 = new MyPoint(30., 10.); //make a point
    segment [0] = new MySegment(p1, p2); //make a segment
    segment [1] = new MySegment(p3, p4); //make a segment
    shape = new MyShape(2, segment); //make a shape
    shape.move(30., 35.); //move the shape at (30.0,35.0)
    shape.plot(); //draw the shape
  }
  
  
  
(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.