public class HTMfunc extends Object
Current Version =============== ID: $Id: HTMfunc.java,v 1.5 2003/02/19 15:46:11 womullan Exp $ Revision: $Revision: 1.5 $ Date/time: $Date: 2003/02/19 15:46:11 $
| Modifier and Type | Field and Description |
|---|---|
(package private) static Object[] |
anchor |
(package private) static Base[] |
bases |
static double |
Epsilon |
(package private) static double |
gEpsilon |
static double |
HTM_INVALID_ID |
static int |
HTMNAMEMAX |
static long |
IDHIGHBIT |
static long |
IDHIGHBIT2 |
static int |
IDSIZE |
static int |
iN0 |
static int |
iN1 |
static int |
iN2 |
static int |
iN3 |
static int |
iS0 |
static int |
iS1 |
static int |
iS2 |
static int |
iS3 |
(package private) static Object[] |
N_indexes |
static double |
Pi |
static double |
Pr |
(package private) static Object[] |
S_indexes |
static double |
sqrt3 |
static Boolean |
verbose |
| Constructor and Description |
|---|
HTMfunc() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
copy_vec(double[] d,
double[] s)
simple utility funtion which copies one vector over another.
|
static double |
distance(double[] v1,
double[] v2)
return the angular distance between two vectors ACOS (V1 .
|
static double |
distance(long htmId1,
long htmId2)
return the angular distance between two htmids gets the vectors of the
mid points and uses thoose to compute distance
|
static double |
distance(String htm1,
String htm2)
return the angular distance between two htm names gets the viectors of
the mid points and uses thoose to compute distance
|
static int |
idLevel(long htmid)
idLevel is a trusting method (assumes that the id is well formed and
valid) that returns the level of the trixel represented by the given 64
bit htmId.
|
static String |
idToName(long id)
Walk the bits of the id and convert it to a string like N012.
|
static double[] |
idToPoint(long htmId)
gets the name from the id and calls idToPoint with it.
|
static double[] |
idToPoint(String name)
for a given ID get back the approximate center of the triangle.
|
static boolean |
isinside(double[] p,
double[] v1,
double[] v2,
double[] v3)
for a given vector p is it contained in the triangle whose corners are
given by the vectors v1, v2,v3.
|
static String |
lookup(double x,
double y,
double z,
int depth) |
static String |
lookup(double ra,
double dec,
int depth)
For given ra and dec lookup the HTMID to given depth HTM works in vectors
so this basically converts ra dec to a vector and calls lookup for the
vector.
|
static long |
lookupId(double x,
double y,
double z,
int depth)
looks up the name of a vector x,y,z and converts the name to an id
|
static long |
lookupId(double ra,
double dec,
int depth) |
protected static void |
m4_midpoint(double[] v1,
double[] v2,
double[] w) |
static long |
nameToId(String name)
for a given name i.e.
|
static Object[] |
nameToTriangle(String name)
Like name2Id but instaed of returning the htmId return v0,v1,v2 vetors
representin the corners of the trinagle
|
static double[] |
radecToVector(double ra,
double dec)
convert ra dec to a vector
|
protected static int |
startpane(double[] v1,
double[] v2,
double[] v3,
double xin,
double yin,
double zin,
StringBuffer name)
where to start in the HTM quadtree when looking for a vectors home xin
yin zin are thin input vector v1 v2 v3 and name are loaded with the
initial tringle points and the name of the triangle
|
public static final Boolean verbose
public static double Pi
public static double Pr
public static double Epsilon
public static double sqrt3
public static final int IDSIZE
public static final long IDHIGHBIT
public static final long IDHIGHBIT2
public static final int HTMNAMEMAX
static double gEpsilon
public static final double HTM_INVALID_ID
public static final int iS2
public static final int iN1
public static final int iS1
public static final int iN2
public static final int iS3
public static final int iN0
public static final int iS0
public static final int iN3
static Object[] anchor
static Object[] S_indexes
static Object[] N_indexes
static Base[] bases
protected static int startpane(double[] v1,
double[] v2,
double[] v3,
double xin,
double yin,
double zin,
StringBuffer name)
throws HTMException
HTMExceptionprotected static final void m4_midpoint(double[] v1,
double[] v2,
double[] w)
public static String lookup(double x, double y, double z, int depth) throws HTMException
HTMExceptionpublic static long lookupId(double x,
double y,
double z,
int depth)
throws HTMException
HTMExceptionpublic static String lookup(double ra, double dec, int depth) throws HTMException
HTMExceptionpublic static double[] radecToVector(double ra,
double dec)
public static long lookupId(double ra,
double dec,
int depth)
throws HTMException
HTMExceptionpublic static boolean isinside(double[] p,
double[] v1,
double[] v2,
double[] v3)
public static long nameToId(String name) throws HTMException
HTMExceptionpublic static int idLevel(long htmid)
public static String idToName(long id) throws HTMException
HTMExceptionpublic static Object[] nameToTriangle(String name)
protected static void copy_vec(double[] d,
double[] s)
d - destination of copys - source of copypublic static double[] idToPoint(String name) throws HTMException
HTMExceptionpublic static double[] idToPoint(long htmId)
throws HTMException
HTMExceptionpublic static double distance(double[] v1,
double[] v2)
public static double distance(long htmId1,
long htmId2)
throws HTMException
HTMExceptionpublic static double distance(String htm1, String htm2) throws HTMException
HTMException