test_class.declarator: OFFSET_X = 11000000
test_class.modifier: static final
test_class.original_string: static final int OFFSET_X = 11000000;
test_class.type: int
test_class.var_name: OFFSET_X
test_class.declarator: OFFSET_Y = 50000000
test_class.modifier: static final
test_class.original_string: static final int OFFSET_Y = 50000000;
test_class.type: int
test_class.var_name: OFFSET_Y
test_class.declarator: polygon
test_class.modifier: static
test_class.original_string: static OsmNogoPolygon polygon;
test_class.type: OsmNogoPolygon
test_class.var_name: polygon
test_class.declarator: polyline
test_class.modifier: static
test_class.original_string: static OsmNogoPolygon polyline;
test_class.type: OsmNogoPolygon
test_class.var_name: polyline
test_class.declarator: lons = {  1.0,  1.0,  0.5, 0.5, 1.0, 1.0, -1.1, -1.0 }
test_class.modifier: static final
test_class.original_string: static final double[] lons = {  1.0,  1.0,  0.5, 0.5, 1.0, 1.0, -1.1, -1.0 };
test_class.type: double[]
test_class.var_name: lons
test_class.declarator: lats = { -1.0, -0.1, -0.1, 0.1, 0.1, 1.0,  1.1, -1.0 }
test_class.modifier: static final
test_class.original_string: static final double[] lats = { -1.0, -0.1, -0.1, 0.1, 0.1, 1.0,  1.1, -1.0 };
test_class.type: double[]
test_class.var_name: lats
test_class.file: brouter-core/src/test/java/btools/router/OsmNogoPolygonTest.java
test_class.identifier: OsmNogoPolygonTest
test_case.body: @Test
    public void testBelongsToLine() {
      assertTrue(OsmNogoPolygon.isOnLine(10,10, 10,10, 10,20));
      assertTrue(OsmNogoPolygon.isOnLine(10,10, 10,10, 20,10));
      assertTrue(OsmNogoPolygon.isOnLine(10,10, 20,10, 10,10));
      assertTrue(OsmNogoPolygon.isOnLine(10,10, 10,20, 10,10));
      assertTrue(OsmNogoPolygon.isOnLine(10,15, 10,10, 10,20));
      assertTrue(OsmNogoPolygon.isOnLine(15,10, 10,10, 20,10));
      assertTrue(OsmNogoPolygon.isOnLine(10,10, 10,10, 20,30));
      assertTrue(OsmNogoPolygon.isOnLine(20,30, 10,10, 20,30));
      assertTrue(OsmNogoPolygon.isOnLine(15,20, 10,10, 20,30));
      assertFalse(OsmNogoPolygon.isOnLine(11,11, 10,10, 10,20));
      assertFalse(OsmNogoPolygon.isOnLine(11,11, 10,10, 20,10));
      assertFalse(OsmNogoPolygon.isOnLine(15,21, 10,10, 20,30));
      assertFalse(OsmNogoPolygon.isOnLine(15,19, 10,10, 20,30));
      assertFalse(OsmNogoPolygon.isOnLine(0,-10, 10,10, 20,30));
      assertFalse(OsmNogoPolygon.isOnLine(30,50, 10,10, 20,30));
    }
test_case.class_method_signature: OsmNogoPolygonTest.testBelongsToLine()
test_case.full_signature: @Test public void testBelongsToLine()
test_case.identifier: testBelongsToLine
test_case.invocations: assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertTrue isOnLine assertFalse isOnLine assertFalse isOnLine assertFalse isOnLine assertFalse isOnLine assertFalse isOnLine assertFalse isOnLine
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testBelongsToLine()
focal_class.declarator: points = new ArrayList<Point>()
focal_class.modifier: public final
focal_class.original_string: public final List<Point> points = new ArrayList<Point>();
focal_class.type: List<Point>
focal_class.var_name: points
focal_class.declarator: isClosed
focal_class.modifier: public final
focal_class.original_string: public final boolean isClosed;
focal_class.type: boolean
focal_class.var_name: isClosed
focal_class.file: brouter-core/src/main/java/btools/router/OsmNogoPolygon.java
focal_class.identifier: OsmNogoPolygon
focal_class.class_method_signature: OsmNogoPolygon.OsmNogoPolygon(boolean closed)
focal_class.full_signature: public  OsmNogoPolygon(boolean closed)
focal_class.identifier: OsmNogoPolygon
focal_class.modifiers: public
focal_class.parameters: (boolean closed)
focal_class.signature:  OsmNogoPolygon(boolean closed)
focal_class.class_method_signature: OsmNogoPolygon.addVertex(int lon, int lat)
focal_class.full_signature: public final void addVertex(int lon, int lat)
focal_class.identifier: addVertex
focal_class.modifiers: public final
focal_class.parameters: (int lon, int lat)
focal_class.return: void
focal_class.signature: void addVertex(int lon, int lat)
focal_class.class_method_signature: OsmNogoPolygon.calcBoundingCircle()
focal_class.full_signature: public void calcBoundingCircle()
focal_class.identifier: calcBoundingCircle
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void calcBoundingCircle()
focal_class.class_method_signature: OsmNogoPolygon.intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.full_signature: public boolean intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.identifier: intersects
focal_class.modifiers: public
focal_class.parameters: (int lon0, int lat0, int lon1, int lat1)
focal_class.return: boolean
focal_class.signature: boolean intersects(int lon0, int lat0, int lon1, int lat1)
focal_class.class_method_signature: OsmNogoPolygon.isOnPolyline( long px, long py )
focal_class.full_signature: public boolean isOnPolyline( long px, long py )
focal_class.identifier: isOnPolyline
focal_class.modifiers: public
focal_class.parameters: ( long px, long py )
focal_class.return: boolean
focal_class.signature: boolean isOnPolyline( long px, long py )
focal_class.class_method_signature: OsmNogoPolygon.isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.full_signature: public static boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.identifier: isOnLine
focal_class.modifiers: public static
focal_class.parameters: ( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.return: boolean
focal_class.signature: boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_class.class_method_signature: OsmNogoPolygon.isWithin(final long px, final long py)
focal_class.full_signature: public boolean isWithin(final long px, final long py)
focal_class.identifier: isWithin
focal_class.modifiers: public
focal_class.parameters: (final long px, final long py)
focal_class.return: boolean
focal_class.signature: boolean isWithin(final long px, final long py)
focal_class.class_method_signature: OsmNogoPolygon.distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.full_signature: public double distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.identifier: distanceWithinPolygon
focal_class.modifiers: public
focal_class.parameters: (int lon1, int lat1, int lon2, int lat2)
focal_class.return: double
focal_class.signature: double distanceWithinPolygon(int lon1, int lat1, int lon2, int lat2)
focal_class.class_method_signature: OsmNogoPolygon.inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.full_signature: private static boolean inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.identifier: inSegment
focal_class.modifiers: private static
focal_class.parameters: ( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.return: boolean
focal_class.signature: boolean inSegment( final Point p, final Point seg_p0, final Point seg_p1)
focal_class.class_method_signature: OsmNogoPolygon.intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.full_signature: private static int intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.identifier: intersect2D_2Segments
focal_class.modifiers: private static
focal_class.parameters: ( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.return: int
focal_class.signature: int intersect2D_2Segments( final Point s1p0, final Point s1p1, final Point s2p0, final Point s2p1 )
focal_class.superclass: extends OsmNodeNamed
focal_method.body: public static boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
    {
      final double v10x = px-p0x;
      final double v10y = py-p0y;
      final double v12x = p1x-p0x;
      final double v12y = p1y-p0y;
  
      if ( v10x == 0 ) // P0->P1 vertical?
      {
        if ( v10y == 0 ) // P0 == P1?
        {
          return true;
        }
        if ( v12x != 0 ) // P1->P2 not vertical?
        {
          return false;
        }
        return ( v12y / v10y ) >= 1; // P1->P2 at least as long as P1->P0?
      }
      if ( v10y == 0 ) // P0->P1 horizontal?
      {
        if ( v12y != 0 ) // P1->P2 not horizontal?
        {
          return false;
        }
        // if ( P10x == 0 ) // P0 == P1? already tested
        return ( v12x / v10x ) >= 1; // P1->P2 at least as long as P1->P0?
      }
      final double kx = v12x / v10x;
      if ( kx < 1 )
      {
        return false;
      }
      return kx == v12y / v10y;
    }
focal_method.class_method_signature: OsmNogoPolygon.isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_method.full_signature: public static boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_method.identifier: isOnLine
focal_method.modifiers: public static
focal_method.parameters: ( long px, long py, long p0x, long p0y, long p1x, long p1y )
focal_method.return: boolean
focal_method.signature: boolean isOnLine( long px, long py, long p0x, long p0y, long p1x, long p1y )