public class PreparedGeometryExample
extends java.lang.Object
PreparedGeometry
in a batch (repeated) operation.
The example uses a Monte Carlo method to approximate the value of Pi.
Given a circle inscribed in a square and a large number of random points
in the square, the number of points which intersect the circle approximates Pi/4.
This involves repeated Point-In-Polygon tests, which is one of the
geometry tests optimized by the PreparedGeometry implementation for polygons.Modifier and Type | Field and Description |
---|---|
(package private) static GeometryFactory |
geomFact |
(package private) static int |
MAX_ITER |
Constructor and Description |
---|
PreparedGeometryExample() |
Modifier and Type | Method and Description |
---|---|
(package private) static Geometry |
createCircle() |
(package private) static Point |
createRandomPoint() |
static void |
main(java.lang.String[] args) |
static GeometryFactory geomFact
static final int MAX_ITER