public interface VerticesAndPathComputer extends HierarchyItem
Modifier and Type | Field and Description |
---|---|
static java.util.EnumSet<CompassPoint.Cardinal> |
ALL_CARDINAL_POINTS
EnumSet containing all elements of the CompassPoint.Cardinal enum. |
static int |
LAT_INDEX
Index of the lattitude in the array containing coordinate on the unit sphere.
|
static int |
LON_INDEX
Index of the longitude in the array containing coordinate on the unit sphere.
|
Modifier and Type | Method and Description |
---|---|
double[] |
center(long hash)
Compute the position on the unit sphere of the center (in the Euclidean projection plane)
of the cell associated to the given hash value.
|
void |
center(long hash,
double[] resultLonLat)
See
center(long) , except that the result is stored in the given array. |
double[][] |
pathAlongCellEdge(long hash,
CompassPoint.Cardinal startingVertex,
boolean clockwiseDirection,
int nSegmentsBySide) |
void |
pathAlongCellEdge(long hash,
CompassPoint.Cardinal startingVertex,
boolean clockwiseDirection,
int nSegmentsBySide,
double[][] pathPoints)
See
#pathAlongCellEdge(long, Cardinal, boolean, int) . |
double[][] |
pathAlongCellSide(long hash,
CompassPoint.Cardinal fromVertex,
CompassPoint.Cardinal toVertex,
boolean isToVertexIncluded,
int nSegments)
Compute points on a given side of a given HEALPix cell on the unit sphere.
|
void |
pathAlongCellSide(long hash,
CompassPoint.Cardinal fromVertex,
CompassPoint.Cardinal toVertex,
boolean isToVertexIncluded,
int nSegments,
double[][] pathPoints)
See
#pathAlongCellSide(long, Cardinal, Cardinal, boolean, int) . |
double[] |
vertex(long hash,
CompassPoint.Cardinal cardinalPoint)
Compute the position of an HEALPix cell vertex on the unit sphere.
|
void |
vertex(long hash,
CompassPoint.Cardinal cardinalPoint,
double[] resultLonLat)
See
#vertex(long, Cardinal) , except that the result is stored in the given array. |
void |
vertices(long hash,
java.util.EnumMap<CompassPoint.Cardinal,double[]> cardinalPoints)
|
java.util.EnumMap<CompassPoint.Cardinal,double[]> |
vertices(long hash,
java.util.EnumSet<CompassPoint.Cardinal> cardinalPoints)
Returns the vertices located at the given cardinal points.
|
depth
static final java.util.EnumSet<CompassPoint.Cardinal> ALL_CARDINAL_POINTS
EnumSet
containing all elements of the CompassPoint.Cardinal
enum.
Defined for users comodity.static final int LON_INDEX
static final int LAT_INDEX
double[] center(long hash)
hash
- hash value of the cell we look for the unprojected centerLON_INDEX
and LAT_INDEX
respectively.
Lat in [-pi/2, pi/2] radians, lon is in [0, 2pi] radians.void center(long hash, double[] resultLonLat)
center(long)
, except that the result is stored in the given array.hash
- hash value of the cell we look for the unprojected center.resultLonLat
- array used to store the result. Must be of size >= 2.double[] vertex(long hash, CompassPoint.Cardinal cardinalPoint)
hash
- hash value of the cell we look for the given vertex.cardinalPoint
- location of the vertex with respect to the cell centerLON_INDEX
and LAT_INDEX
respectively.
Lat is in [-pi/2, pi/2] radians, lon is in [0, 2pi] radians.void vertex(long hash, CompassPoint.Cardinal cardinalPoint, double[] resultLonLat)
#vertex(long, Cardinal)
, except that the result is stored in the given array.hash
- hash value of the cell we look for the given vertex.cardinalPoint
- location of the vertex with respect to the cell centerresultLonLat
- array used to store the result. Must be of size >= 2.java.util.EnumMap<CompassPoint.Cardinal,double[]> vertices(long hash, java.util.EnumSet<CompassPoint.Cardinal> cardinalPoints)
EnumSet.allOf(Cardinal)
.
For West and East vertices, use EnumSet.of(Cardinal.W, Cardinal.E)
.hash
- hash value of the cell we look for the given vertices.cardinalPoints
- locations of the vertices we look for the positionsLON_INDEX
and LAT_INDEX
respectively.
Lat is in [-pi/2, pi/2] radians, lon is in [0, 2pi] radians.void vertices(long hash, java.util.EnumMap<CompassPoint.Cardinal,double[]> cardinalPoints)
vertices(long, EnumSet)
. The difference is that the user provides a
pre-set Map. The structure of the Map is not modified, but the coordinates of the values
(array values) are overwritten. An error will be thrown if a value is null or contains
less than two elements.hash
- hash value of the cell we look for the given vertices.cardinalPoints
- the map to be modified ydouble[][] pathAlongCellSide(long hash, CompassPoint.Cardinal fromVertex, CompassPoint.Cardinal toVertex, boolean isToVertexIncluded, int nSegments)
hash
- hash value of the cell we look for side path on the unit sphere.fromVertex
- direction (from the cell center) of the path starting vertextoVertex
- direction (from the cell center) of the path ending vertexisToVertexIncluded
- if false
, the result contains nSegments
points and do
no include the result ending vertex. Else the result contains
nSegments + 1
points.nSegments
- number of segments in the path from the starting vertex to the ending vertexvoid pathAlongCellSide(long hash, CompassPoint.Cardinal fromVertex, CompassPoint.Cardinal toVertex, boolean isToVertexIncluded, int nSegments, double[][] pathPoints)
#pathAlongCellSide(long, Cardinal, Cardinal, boolean, int)
. The difference is that
the user provides a list of points whose coordinates are going to be overwritten.
An error will be thrown if the array (of array) is not large enough (i.e. its is smaller than
nSegments or nSegments + 1) or if one of the array is null or contains less than two elements.hash
- hash value of the cell we look for side path on the unit sphere.fromVertex
- direction (from the cell center) of the path starting vertextoVertex
- direction (from the cell center) of the path ending vertexisToVertexIncluded
- if false
, the result contains nSegments
points and do
no include the result ending vertex. Else the result contains
nSegments + 1
points.nSegments
- number of segments in the path from the starting vertex to the ending vertexpathPoints
- object used to store the result.double[][] pathAlongCellEdge(long hash, CompassPoint.Cardinal startingVertex, boolean clockwiseDirection, int nSegmentsBySide)
hash
- hash value of the cell we look for the edge path on the unit sphere.startingVertex
- direction (from the cell center) of the path starting vertexclockwiseDirection
- if true
, result points are stored in a clockwise direction
order, else they are stored in counter-clockwise direction order.nSegmentsBySide
- number of segments in each each side is divided. Hence, the total number
of points in the result is 4 x nSegmentsBySide
.void pathAlongCellEdge(long hash, CompassPoint.Cardinal startingVertex, boolean clockwiseDirection, int nSegmentsBySide, double[][] pathPoints)
#pathAlongCellEdge(long, Cardinal, boolean, int)
. The difference is that the user
provides a list of points whose coordinates are going to be overwritten.
An error will be thrown if the array (of array) is not large enough (i.e. its is smaller than
4 *nSegments) or if one of the array is null or contains less than two elements.hash
- hash hash value of the cell we look for the edge path on the unit sphere.startingVertex
- direction (from the cell center) of the path starting vertexclockwiseDirection
- if true
, result points are stored in a clockwise direction
order, else they are stored in counter-clockwise direction order.nSegmentsBySide
- number of segments in each each side is divided. Hence, the total number
of points in the result is 4 x nSegmentsBySide
.pathPoints
- object used to store the result.Copyright © 2018 F.-X. Pineau, CDS, Observatoire Astronomique de Strasbourg, Universite de Strasbourg, CNRS. All Rights Reserved.