@Test public void testContains() { AnnularSector sector = new AnnularSector(new PolarVector2(1.0,Math.PI / 4)); ArrayList<PolarVector2> pointsOutside = new ArrayList<PolarVector2>(); pointsOutside.add(new PolarVector2(2.0,Math.PI / 8)); pointsOutside.add(new PolarVector2(0.5,Math.PI / 2)); pointsOutside.add(new PolarVector2(11.0,3 * Math.PI / 2)); pointsOutside.add(new PolarVector2(0.0,0.0)); ArrayList<PolarVector2> pointsInside = new ArrayList<PolarVector2>(); Iterator<PolarVector2> iterator = pointsOutside.iterator(); while (iterator.hasNext()) { PolarVector2 point = iterator.next(); sector.expandBy(point); pointsInside.add(point); iterator.remove(); for (PolarVector2 outside : pointsOutside) { assertFalse(sector.contains(outside)); } for (PolarVector2 inside : pointsInside) { assertTrue(sector.contains(inside)); } } }
public boolean contains(Vector2 position) { PolarVector2 pv = new PolarVector2(position); return this.contains(pv); }
AnnularSector implements IsSerializable { public boolean contains(Vector2 position) { PolarVector2 pv = new PolarVector2(position); return this.contains(pv); } }
AnnularSector implements IsSerializable { public boolean contains(Vector2 position) { PolarVector2 pv = new PolarVector2(position); return this.contains(pv); } AnnularSector();  AnnularSector(PolarVector2 min, PolarVector2 max);  AnnularSector(PolarVector2 initPoint); }
AnnularSector implements IsSerializable { public boolean contains(Vector2 position) { PolarVector2 pv = new PolarVector2(position); return this.contains(pv); } AnnularSector();  AnnularSector(PolarVector2 min, PolarVector2 max);  AnnularSector(PolarVector2 initPoint); PolarVector2 getMin(); void setMin(PolarVector2 min); PolarVector2 getMax(); void setMax(PolarVector2 max); void expandBy(AnnularSector other); void expandBy(Vector2 v); void expandBy(PolarVector2 pv); boolean contains(Vector2 position); boolean contains(PolarVector2 pv); boolean intersects(AnnularSector other); Box2D cartesianBounds(); boolean isValid(); Box2D getOuterArcBounds(); @Override String toString(); }
AnnularSector implements IsSerializable { public boolean contains(Vector2 position) { PolarVector2 pv = new PolarVector2(position); return this.contains(pv); } AnnularSector();  AnnularSector(PolarVector2 min, PolarVector2 max);  AnnularSector(PolarVector2 initPoint); PolarVector2 getMin(); void setMin(PolarVector2 min); PolarVector2 getMax(); void setMax(PolarVector2 max); void expandBy(AnnularSector other); void expandBy(Vector2 v); void expandBy(PolarVector2 pv); boolean contains(Vector2 position); boolean contains(PolarVector2 pv); boolean intersects(AnnularSector other); Box2D cartesianBounds(); boolean isValid(); Box2D getOuterArcBounds(); @Override String toString();  }