Package cds.healpix.fillingcurve
Interface FillingCurve2D
public interface FillingCurve2D
Interface defining a two-dimensional space-filling curve.
It provides method to transform a pair of 2d-coordinates in a single index in the curve.
The index value is here called hash value since the intput parameters are discritized
coordinates, and information is lost during the discretization.
- Author:
- F.-X. Pineau
-
Method Summary
Modifier and TypeMethodDescriptionlong
hash2i0
(long hash) Special case ofhash2ij(long)
in which the discretized coordinate along the vertical axis equals zero.long
hash2ij
(long hash) Transforms the given space filling curve index (or hash value) into a single value from which it is straightforward to extract the associated 2d-coordinates using methodsij2i(long)
andij2j(long)
.long
i02hash
(int i) Special case ofij2hash(int, int)
in which the discretized coordinate along the vertical axis equals zero.long
ij2hash
(int i, int j) Transforms coordinates in a discretized 2d-plane into a space filling curve index.int
ij2i
(long ij) Extract the discretized horizontal coordinates from the result of the methodhash2ij(long)
.int
ij2j
(long ij) Extract the discretized vertical coordinates from the result of the methodhash2ij(long)
.long
xy2hash
(double x, double y) The default implementation (not implemented to stay compatible with Java Version < 8) should be:return ij2hash((int) x, (int) y)
.
-
Method Details
-
xy2hash
long xy2hash(double x, double y) The default implementation (not implemented to stay compatible with Java Version < 8) should be:return ij2hash((int) x, (int) y)
.- Parameters:
x
- coordinate along the horizontal axisy
- coordinate along the vertical axis- Returns:
- the space filling curve index (or hash value) associated to the given 2d-coordinates.
-
ij2hash
long ij2hash(int i, int j) Transforms coordinates in a discretized 2d-plane into a space filling curve index. This can be thought of as computing a hash value from 2d-coordinates.- Parameters:
i
- discretized coordinate along the horizontal axisj
- discretized coordinate along the vertical axis- Returns:
- the space filling curve index (or hash value) associated to the given discretized 2d-coordinates.
-
i02hash
long i02hash(int i) Special case ofij2hash(int, int)
in which the discretized coordinate along the vertical axis equals zero.- Parameters:
i
- discretized coordinate along the horizontal axis- Returns:
- the space filling curve index (or hash value) associated to the given discretized horizontal coordinate, assuming the discretized vertical coordinate equal zero.
-
hash2ij
long hash2ij(long hash) Transforms the given space filling curve index (or hash value) into a single value from which it is straightforward to extract the associated 2d-coordinates using methodsij2i(long)
andij2j(long)
.- Parameters:
hash
- the space filling curve index (or hash value)- Returns:
- a single value from which it is straightforward to extract the associated
2d-coordinates using methods
ij2i(long)
andij2j(long)
.
-
hash2i0
long hash2i0(long hash) Special case ofhash2ij(long)
in which the discretized coordinate along the vertical axis equals zero.- Parameters:
hash
- the space filling curve index (or hash value)- Returns:
- a single value, knowing the vertical coordinate equals zero, from which it is
straightforward to extract the associated horizontal coordinate using method
ij2i(long)
.
-
ij2i
int ij2i(long ij) Extract the discretized horizontal coordinates from the result of the methodhash2ij(long)
.- Parameters:
ij
- result of the methodhash2ij(long)
- Returns:
- the discretized horizontal coordinate stored in the given parameter
ij
-
ij2j
int ij2j(long ij) Extract the discretized vertical coordinates from the result of the methodhash2ij(long)
.- Parameters:
ij
- result of the methodhash2ij(long)
- Returns:
- the discretized horizontal coordinate stored in the given parameter
ij
-