package gov.fnal.eag.healpix.test; import java.util.ArrayList; import javax.vecmath.Vector3d; import gov.fnal.eag.healpix.PixTools; import gov.fnal.eag.healpix.Region; import gov.fnal.eag.healpix.BitManipulation; import junit.framework.TestCase; /** * @author kuropat * Junit methods to test Region class */ public class RegionTest extends TestCase { private final static double TWOPI = 2.0 * Math.PI; private final static double epsilon = 1.0e-10; private BitManipulation bm = new BitManipulation(); /** * test default constructor */ public void testRegion() { double xMin = 0.; double xMax = 30.; double yMin = 0.; double yMax = 10.; PixTools pt = new PixTools(); Region rg = new Region(xMin,xMax,yMin,yMax); assertNotNull(rg); double x = -10.; double y = 15.; assertFalse(rg.inReg(x,y)); x = 10.; y = 5.; assertTrue(rg.inReg(x,y)); xMax = -10.; ArrayList vert = rg.getVertices(); double[][] vertPol = rg.getPolReg(); for ( int ind=0; ind