Package purrpackagedemo.aggregate

Source Code of purrpackagedemo.aggregate.TestIntersection

package purrpackagedemo.aggregate;

import junit.framework.TestCase;

import org.junit.Test;

import purrpackagedemo.Point;
import purrpackagedemo.Transformation;
import purrpackagedemo.polygon.Polygon;

public class TestIntersection extends TestCase {

  @Test
  public void testContains() {
    Transformation t = new Transformation.Translation( 0.5, 0.5 );
    Intersection r = new Intersection( Polygon.UNIT_SQUARE, t.apply( Polygon.UNIT_SQUARE ) );
    assertFalse( r.contains( Point.ORIGIN ));
    assertTrue( r.contains( new Point( 0.75, 0.75 )));
    assertFalse( r.contains( new Point( .75, .25 )));
    assertFalse( r.contains( new Point( .25, .25 )));
    assertFalse( r.contains( new Point( .25, .65 )));
  }

 
}
TOP

Related Classes of purrpackagedemo.aggregate.TestIntersection

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.