public class Geometry
extends java.lang.Object
Constructor and Description |
---|
Geometry() |
Modifier and Type | Method and Description |
---|---|
static boolean |
linesIntersect(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4)
Determines whether the two line segments p1->p2 and p3->p4, given by
p1=(x1, y1), p2=(x2,y2), p3=(x3,y3), p4=(x4,y4) intersect.
|
static boolean |
polygonContainsPoint(PointList points,
int x,
int y)
One simple way of finding whether the point is inside or outside a simple
polygon is to test how many times a ray starting from the point
intersects the edges of the polygon.
|
static boolean |
polylineContainsPoint(PointList points,
int x,
int y,
int tolerance) |
public static boolean linesIntersect(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
x1
- x coordinate of starting point of line segment 1y1
- y coordinate of starting point of line segment 1x2
- x coordinate of ending point of line segment 1y2
- y coordinate of ending point of line segment 1x3
- x coordinate of the starting point of line segment 2y3
- y coordinate of the starting point of line segment 2x4
- x coordinate of the ending point of line segment 2y4
- y coordinate of the ending point of line segment 2true
if the two line segments formed by the given
coordinates share at least one common point.public static boolean polylineContainsPoint(PointList points, int x, int y, int tolerance)
PointList.polylineContainsPoint(int, int, int)
public static boolean polygonContainsPoint(PointList points, int x, int y)
PointList.polygonContainsPoint(int, int)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.