|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.jhu.htm.core.HTMfunc
These are the core routines for the HTM. They are a direct lift from cc_aux but modifed along the lined of the new design In pratically all cases below a double[] is a vector of 3 numbers representing x,y,z in the unit sphere.
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 $
Field Summary | |
static double |
Epsilon
|
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
|
static double |
Pi
|
static double |
Pr
|
static double |
sqrt3
|
static boolean |
verbose
|
Constructor Summary | |
HTMfunc()
|
Method Summary | |
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(java.lang.String htm1,
java.lang.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 java.lang.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(java.lang.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 java.lang.String |
lookup(double x,
double y,
double z,
int depth)
|
static java.lang.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(java.lang.String name)
for a given name i.e. |
static java.lang.Object[] |
nameToTriangle(java.lang.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,
java.lang.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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static 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
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
Constructor Detail |
public HTMfunc()
Method Detail |
protected static int startpane(double[] v1, double[] v2, double[] v3, double xin, double yin, double zin, java.lang.StringBuffer name) throws HTMException
HTMException
protected static final void m4_midpoint(double[] v1, double[] v2, double[] w)
public static java.lang.String lookup(double x, double y, double z, int depth) throws HTMException
HTMException
public static long lookupId(double x, double y, double z, int depth) throws HTMException
HTMException
public static java.lang.String lookup(double ra, double dec, int depth) throws HTMException
HTMException
public static double[] radecToVector(double ra, double dec)
public static long lookupId(double ra, double dec, int depth) throws HTMException
HTMException
public static boolean isinside(double[] p, double[] v1, double[] v2, double[] v3)
public static long nameToId(java.lang.String name) throws HTMException
HTMException
public static int idLevel(long htmid)
public static java.lang.String idToName(long id) throws HTMException
HTMException
public static java.lang.Object[] nameToTriangle(java.lang.String name)
protected static void copy_vec(double[] d, double[] s)
d
- destination of copys
- source of copypublic static double[] idToPoint(java.lang.String name) throws HTMException
HTMException
public static double[] idToPoint(long htmId) throws HTMException
HTMException
public static double distance(double[] v1, double[] v2)
public static double distance(long htmId1, long htmId2) throws HTMException
HTMException
public static double distance(java.lang.String htm1, java.lang.String htm2) throws HTMException
HTMException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |