test_class.declarator: pentagon
test_class.modifier: private static
test_class.original_string: private static Polygon pentagon;
test_class.type: Polygon
test_class.var_name: pentagon
test_class.declarator: concavePentagon
test_class.modifier: private static
test_class.original_string: private static Polygon concavePentagon;
test_class.type: Polygon
test_class.var_name: concavePentagon
test_class.declarator: complexPentagon
test_class.modifier: private static
test_class.original_string: private static Polygon complexPentagon;
test_class.type: Polygon
test_class.var_name: complexPentagon
test_class.file: singa-mathematics/src/test/java/bio/singa/mathematics/geometry/faces/PolygonsTest.java
test_class.identifier: PolygonsTest
test_case.body: @Test
      @DisplayName("evaluate point position - complex polygon")
      void testPointInsidePolygon3() {
          assertTrue(Polygons.containsVector(complexPentagon, new Vector2D(6.0, 3.0)));
          assertFalse(Polygons.containsVector(complexPentagon, new Vector2D(6.0, 4.0)));
          assertTrue(Polygons.containsVector(complexPentagon, new Vector2D(6.0, 5.0)));
      }
test_case.class_method_signature: PolygonsTest.testPointInsidePolygon3()
test_case.full_signature: @Test @DisplayName("evaluate point position - complex polygon") void testPointInsidePolygon3()
test_case.identifier: testPointInsidePolygon3
test_case.invocations: assertTrue containsVector assertFalse containsVector assertTrue containsVector
test_case.modifiers: @Test @DisplayName("evaluate point position - complex polygon")
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPointInsidePolygon3()
focal_class.declarator: OUTSIDE = -1
focal_class.modifier: public static final
focal_class.original_string: public static final int OUTSIDE = -1;
focal_class.type: int
focal_class.var_name: OUTSIDE
focal_class.declarator: ON_LINE = 0
focal_class.modifier: public static final
focal_class.original_string: public static final int ON_LINE = 0;
focal_class.type: int
focal_class.var_name: ON_LINE
focal_class.declarator: INSIDE = 1
focal_class.modifier: public static final
focal_class.original_string: public static final int INSIDE = 1;
focal_class.type: int
focal_class.var_name: INSIDE
focal_class.file: singa-mathematics/src/main/java/bio/singa/mathematics/geometry/faces/Polygons.java
focal_class.identifier: Polygons
focal_class.class_method_signature: Polygons.containsVector(Polygon polygon, Vector2D vector)
focal_class.full_signature: public static boolean containsVector(Polygon polygon, Vector2D vector)
focal_class.identifier: containsVector
focal_class.modifiers: public static
focal_class.parameters: (Polygon polygon, Vector2D vector)
focal_class.return: boolean
focal_class.signature: boolean containsVector(Polygon polygon, Vector2D vector)
focal_class.class_method_signature: Polygons.getTouchingLineSegments(Polygon first, Polygon second)
focal_class.full_signature: public static Map<Pair<LineSegment>, LineSegment> getTouchingLineSegments(Polygon first, Polygon second)
focal_class.identifier: getTouchingLineSegments
focal_class.modifiers: public static
focal_class.parameters: (Polygon first, Polygon second)
focal_class.return: Map<Pair<LineSegment>, LineSegment>
focal_class.signature: Map<Pair<LineSegment>, LineSegment> getTouchingLineSegments(Polygon first, Polygon second)
focal_class.class_method_signature: Polygons.unitVectorsAreParallel(Vector2D firstUnitVector, Vector2D secondUnitVector)
focal_class.full_signature: private static boolean unitVectorsAreParallel(Vector2D firstUnitVector, Vector2D secondUnitVector)
focal_class.identifier: unitVectorsAreParallel
focal_class.modifiers: private static
focal_class.parameters: (Vector2D firstUnitVector, Vector2D secondUnitVector)
focal_class.return: boolean
focal_class.signature: boolean unitVectorsAreParallel(Vector2D firstUnitVector, Vector2D secondUnitVector)
focal_method.body: public static boolean containsVector(Polygon polygon, Vector2D vector) {
          // checks complex (convex and intersecting polygons)
          // http://alienryderflex.com/polygon
          int polyCorners = polygon.getNumberOfVertices();
          int j = polyCorners - 1;
          boolean oddNodes = false;
  
          List<Vector2D> vertices = polygon.getVertices();
          double x = vector.getX();
          double y = vector.getY();
          for (int i = 0; i < polyCorners; i++) {
              double polyXi = vertices.get(i).getX();
              double polyYi = vertices.get(i).getY();
              double polyXj = vertices.get(j).getX();
              double polyYj = vertices.get(j).getY();
              if ((polyYi < y && polyYj >= y || polyYj < y && polyYi >= y) && (polyXi <= x || polyXj <= x)) {
                  oddNodes ^= (polyXi + (y - polyYi) / (polyYj - polyYi) * (polyXj - polyXi) < x);
              }
              j = i;
          }
          return oddNodes;
      }
focal_method.class_method_signature: Polygons.containsVector(Polygon polygon, Vector2D vector)
focal_method.full_signature: public static boolean containsVector(Polygon polygon, Vector2D vector)
focal_method.identifier: containsVector
focal_method.invocations: getNumberOfVertices getVertices getX getY getX get getY get getX get getY get
focal_method.modifiers: public static
focal_method.parameters: (Polygon polygon, Vector2D vector)
focal_method.return: boolean
focal_method.signature: boolean containsVector(Polygon polygon, Vector2D vector)