On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

Eclipse Draw2d
3.3

## org.eclipse.draw2d.geometry Class Geometry

```java.lang.Object

org.eclipse.draw2d.geometry.Geometry
```

public class Geometry
extends java.lang.Object

A Utilities class for geometry operations.

Since:
3.1

 Constructor Summary ``` Geometry ()```

 Method Summary `static boolean` ``` linesIntersect (int ux, int uy, int vx, int vy, int sx, int sy, int tx, int ty)```           Determines whether the two line segments formed by the given coordinates 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)```

 Methods inherited from class java.lang.Object `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

 Constructor Detail

### Geometry

`public Geometry()`
 Method Detail

### linesIntersect

```public static boolean linesIntersect(int ux,
int uy,
int vx,
int vy,
int sx,
int sy,
int tx,
int ty)```
Determines whether the two line segments formed by the given coordinates intersect. If one of the two line segments starts or ends on the other line, then they are considered to be intersecting.

Parameters:
`ux` - x coordinate of starting point of line 1
`uy` - y coordinate of starting point of line 1
`vx` - x coordinate of ending point of line 1
`vy` - y coordinate of endpoing point of line 1
`sx` - x coordinate of the starting point of line 2
`sy` - y coordinate of the starting point of line 2
`tx` - x coordinate of the ending point of line 2
`ty` - y coordinate of the ending point of line 2
Returns:
`true` if the two line segments formed by the given coordinates cross
Since:
3.1

### polylineContainsPoint

```public static boolean polylineContainsPoint(
PointList points,
int x,
int y,
int tolerance)```
Since:
3.5
`PointList.polylineContainsPoint(int, int, int)`

### polygonContainsPoint

```public 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. If the point in question is not on the boundary of the polygon, the number of intersections is an even number if the point is outside, and it is odd if inside.

Since:
3.5
`PointList.polygonContainsPoint(int, int)`