public final class Polygon
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Polygon.ContainsSouthPoleComputer
Defines the method used to know if the south pole is in the polygon or in its complement.
|
Constructor and Description |
---|
Polygon(CooXYZ[] polyVertices)
Create a new polygon from the given list of vertices, using the
Polygon.ContainsSouthPoleComputer.BASIC method to define its inside and outside. |
Polygon(CooXYZ[] polyVertices,
Polygon.ContainsSouthPoleComputer cspc)
Create a new polygon from the given list of vertices, using the
given method to define its inside and outside.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(CooXYZ p)
Returns
true if the polygon contain the point p. |
boolean |
intersectSegAB(CooXYZ a,
CooXYZ b)
Returns
true if an edge of the polygone intersects the line defined by the two given
points. |
int |
nVertices()
Returns the number of vertices the polygon contains.
|
CooXYZ |
vertex(int vertexIndex)
Returns the vertex located at the given index in the polygin vertex list.
|
public Polygon(CooXYZ[] polyVertices)
Polygon.ContainsSouthPoleComputer.BASIC
method to define its inside and outside.polyVertices
- vertices defining the polygonpublic Polygon(CooXYZ[] polyVertices, Polygon.ContainsSouthPoleComputer cspc)
Polygon.ContainsSouthPoleComputer.STD_FXP
and
Polygon.ContainsSouthPoleComputer.STD_IVOA
may not work properly!!polyVertices
- vertices defining the polygoncspc
- method used to defined the inside and the outside of the polygon.
So far do not use
Polygon.ContainsSouthPoleComputer.STD_FXP
and Polygon.ContainsSouthPoleComputer.STD_IVOA
.public int nVertices()
public CooXYZ vertex(int vertexIndex)
vertexIndex
- index of the vertex we want to access (in [0, nVertices[public boolean contains(CooXYZ p)
true
if the polygon contain the point p.p
- point to testtrue
if the polygon contain the point p.public boolean intersectSegAB(CooXYZ a, CooXYZ b)
true
if an edge of the polygone intersects the line defined by the two given
points.a
- first segment pointb
- second segment pointtrue
if an edge of the polygone intersects the line defined by the two given
points.Copyright © 2018 F.-X. Pineau, CDS, Observatoire Astronomique de Strasbourg, Universite de Strasbourg, CNRS. All Rights Reserved.