Static Public Member Functions | |
static SqlString | fHtmVersion () |
fHtmVersion() returns the version number of this htm library as a string | |
static long | fHtmXyz (double x, double y, double z) |
fHtmXyz(x,y,z) returns the 20-deep HtmID of the given cartesian point. There are no error cases. All vectors are nomalized and 0,0,0 maps to 1,0,0 | |
static long | fHtmEq (double ra, double dec) |
fHtmEq(ra,dec) returns the 20-deep HtmID of the given equatorial point. There are no error cases. all RA, folded to [0..360] and dec to [-90...90] | |
static long | fHtmLatLon (double lat, double lon) |
fHtm(lat,lon) returns the 20-deep HtmID of the given location. There are no error cases. all RA, folded to [0..360] and dec to [0...90] | |
static SqlDouble | fDistanceEq (double ra1, double dec1, double ra2, double dec2) |
double fDistanceEq(ra1,dec1,ra2,dec2) returns distance in ArcMinutes between two points. | |
static SqlDouble | fDistanceLatLon (double lat1, double lon1, double lat2, double lon2) |
double fDistanceLatLon(lat1,lon1,lat2,lon2) returns distance in ArcMinutes between two points. | |
static SqlDouble | fDistanceXyz (double x1, double y1, double z1, double x2, double y2, double z2) |
double fDistanceXyz(x1,y1,z1,x2,y2,z2) returns distance in ArcMinutes between two points. | |
static SqlString | fHtmToString (SqlInt64 HtmID) |
fHtmToString(HtmID) returns varchar(max)a string describing the HtmID | |
static IEnumerable | fHtmLatLonToXyz (SqlDouble lat, SqlDouble lon) |
XyzTable(x,y,z) fHtmLatLonToXyz(lat, lon) converts an lat,lon point to a table with one row containing the cartesian point (x,y,z). | |
static IEnumerable | fHtmEqToXyz (SqlDouble ra, SqlDouble dec) |
XyzTable(x,y,z) fHtmEqToXyz(ra, dec) converts an equitorial point to a table with one row containing the cartesian point (x,y,z). | |
static IEnumerable | fHtmXyzToLatLon (SqlDouble x, SqlDouble y, SqlDouble z) |
LatLonTable(lat,lon) fHtmXyzToLatLon(x,y,z) converts the cartesian point (x,y,z) to a table with one row containing the equivalent lat,lon point. | |
static IEnumerable | fHtmXyzToEq (SqlDouble x, SqlDouble y, SqlDouble z) |
EqTable(ra, dec) fHtmXyzToEq(x,y,z) converts the cartesian point (x,y,z) to a table with one row containing the equivalent equitorial (ra,dec) point. | |
static IEnumerable | fHtmToCenterPoint (SqlInt64 HtmID) |
fHtmToCenterPoint(HtmID) converts an HTM triangle ID to an (x,y,z) vector of the HTM triangle centerpoint. and returns that vector as the only row of a table. | |
static IEnumerable | fHtmToCornerPoints (SqlInt64 HtmID) |
fHtmToCornerPoints(HtmID) converts an HTM triangle ID to an table of three (x,y,z) vectors of the HTM triangle corners. | |
static IEnumerable | fHtmCoverCircleLatLon (SqlDouble lat, SqlDouble lon, SqlDouble radiusArcMin) |
fHtmCoverCircleLatLon(ra,dec,radiusArcMin) returns a trixel table (a list) covering the circle centered at that lat,lon, within that arc-minute radius. A trixel table is a list of HtmIDStart,HtmIDEnd pairs that describe the HTM triangles (all points of a triangle are between its HtmIDStart and HtmIDEnd. | |
static IEnumerable | fHtmCoverCircleEq (SqlDouble ra, SqlDouble dec, SqlDouble radiusArcMin) |
fHtmCoverCircleEq(ra,dec,radiusArcMin) returns a trixel table (a list) covering the circle centered at that J2000 ra,dec, within that arc-minute radius. A trixel table is a list of HtmStart,HtmStop pairs that describe the HTM triangles (all points of a triangle are between its HtmStart and HtmStop. | |
static IEnumerable | fHtmCoverCircleXyz (SqlDouble x, SqlDouble y, SqlDouble z, SqlDouble radiusArcMin) |
fHtmCoverCircleXyz(x,y,z,radiusArcMin) returns a trixel table (a list) covering the circle centered at that x,y,z, within that arc-minute radius. A trixel table is a list of HtmIDStart,HtmIDEnd pairs that describe the HTM triangles (all points of a triangle are between its HtmIDStart and HtmIDEnd. | |
static IEnumerable | fHtmCoverList (SqlString coverspec) |
fHtmCoverList(regionspec) returns a list of HtmID's that describe the HTM triangles covering the region. | |
static IEnumerable | fHtmCoverRegionSelect (SqlString coverspec, SqlString kind) |
fHtmCoverRegionSelect(regionspec) returns a the qualified list of HtmIDStart,HtmIDEnd pairs that describe the level 20 trixels covering the region. | |
static IEnumerable | fHtmCoverRegion (SqlString coverspec) |
static IEnumerable | fHtmCoverTypedRegion (SqlString coverspec) |
fHtmCoverTypedRegion(region) returns a list of HtmStart,HtmStop pairs that describe the HTM triangles covering the region. Full and Partial triangles. are treated separately. | |
static IEnumerable | fHtmRegionToTable (SqlString coverspec) |
fHtmRegionToTable(region) converts a region definiton a table of halfspaces | |
static SqlString | fHtmRegionToNormalFormString (SqlString coverspec) |
fHtmRegionToNormalFormString(coverspec) converts a region definiton to normal form | |
static SqlString | fHtmRegionError (SqlString coverspec) |
fHtmRegionError(coverspec) returns diagnostic message appropriate for a bad region string | |
Classes | |
class | AugPair |
AugPair is a pair of HtmID's with a flag. It defines the format of IEnumerable list elements returned by the htm cover functions that treat partial and full separately These lists are recast as tables of the form T(HTM_start bigint, HTM_end bigint, full bool) where full = true means range consists of full trixels, else partial. | |
class | DPair |
DPair is a pair of doubles It defines the format of IEnumerable list elements returned by the ..ToLatLon functions. These lists are recast as tables of the form T(ra float, dec float) as well as lat and lon. | |
class | HSEntry |
HSentry is a halfspace entry in a row: convexID halfspaceID x y z D. | |
class | Pair |
Pair is a pair of HtmID pair. It defines the format of IEnumerable list elements returned by the htm cover functions. These lists are recast as tables of the form T(HTM_start bigint, HTM_end bigint). | |
class | Scalar |
Scalar is a 1-tuple of HtmID. It defines the format of IEnumerable list elements returned by the htm cover list function. These lists are recast as tables of the form T(HTM_id bigint). | |
class | Triple |
Triple is a is an X, Y, Z vector in Cartesian space. It defines the format of IEnumerable list elements returned by the htmToVerticies function. These lists are recast a a table of the form T(x float, y float, z float). |
static SqlString Spherical.Htm.Sql.fHtmVersion | ( | ) | [static] |
fHtmVersion() returns the version number of this htm library as a string
create function fHtmVersion() returns nvarchar(max) as external name HTM.Sql.fHtmVersion declare @version nvarchar(max) select @version = dbo.fHtmVersion()
static long Spherical.Htm.Sql.fHtmXyz | ( | double | x, | |
double | y, | |||
double | z | |||
) | [static] |
fHtmXyz(x,y,z) returns the 20-deep HtmID of the given cartesian point.
There are no error cases. All vectors are nomalized and 0,0,0 maps to 1,0,0
x | double, x Cartesian coordinate | |
y | double, y Cartesian coordinate | |
z | double, z Cartesian coordinate |
create function fHtmXyz(@x float, @y float, @z float) returns bigint as external name HTM.Sql.fHtmXyz declare @HtmID bigint select @HtmID = dbo.fHtmXyz(1,0,0)
static long Spherical.Htm.Sql.fHtmEq | ( | double | ra, | |
double | dec | |||
) | [static] |
fHtmEq(ra,dec) returns the 20-deep HtmID of the given equatorial point.
There are no error cases. all RA, folded to [0..360] and dec to [-90...90]
ra | double, right ascencion coordinate (degrees) | |
dec | double, declination coordinate (degrees) |
create function fHtmEq(@ra float, @dec float ) returns bigint as external name HTM.Sql.fHtmEq declare @HtmID bigint select @HtmID = dbo.fHtmEq(195,5) --
static long Spherical.Htm.Sql.fHtmLatLon | ( | double | lat, | |
double | lon | |||
) | [static] |
fHtm(lat,lon) returns the 20-deep HtmID of the given location.
There are no error cases. all RA, folded to [0..360] and dec to [0...90]
lat | double, latitude coordinate (degrees) | |
lon | double, longitude coordinate (degrees) |
create function fHtmLatLon(@lat float, @lon float ) returns bigint as external name HTM.Sql.fHtmLatLon declare @HtmID bigint select @HtmID = dbo.fHtmLatLon(5, 195) -- output defaults to ''
static SqlDouble Spherical.Htm.Sql.fDistanceEq | ( | double | ra1, | |
double | dec1, | |||
double | ra2, | |||
double | dec2 | |||
) | [static] |
double fDistanceEq(ra1,dec1,ra2,dec2) returns distance in ArcMinutes between two points.
ra1 | double, right ascencion coordinate (degrees) | |
dec1 | double, declination coordinate (degrees) | |
ra2 | double, right ascencion coordinate (degrees) | |
dec2 | double, declination coordinate (degrees) |
create function fDistanceEq(@ra1 float, @dec1 float, @ra2 float, @dec2 float) returns float as external name HTM.Sql.fDistanceEq select dbo.fDistanceEq(0,0,30,30)
static SqlDouble Spherical.Htm.Sql.fDistanceLatLon | ( | double | lat1, | |
double | lon1, | |||
double | lat2, | |||
double | lon2 | |||
) | [static] |
double fDistanceLatLon(lat1,lon1,lat2,lon2) returns distance in ArcMinutes between two points.
lat1 | double, latitude coordinate (degrees) | |
lon1 | double, longitude coordinate (degrees) | |
lat2 | double, latitude coordinate (degrees) | |
lon2 | double, longitude coordinate (degrees) |
create function fDistanceLatLon(@lat1 float, @lon1 float, @lat2 float, @lon2 float) returns float as external name HTM.Sql.fDistanceLatLon select dbo.fDistanceLatLon(0,0,30,30)
static SqlDouble Spherical.Htm.Sql.fDistanceXyz | ( | double | x1, | |
double | y1, | |||
double | z1, | |||
double | x2, | |||
double | y2, | |||
double | z2 | |||
) | [static] |
double fDistanceXyz(x1,y1,z1,x2,y2,z2) returns distance in ArcMinutes between two points.
x1 | double, first x Cartesian coordinate | |
y1 | double, first y Cartesian coordinate | |
z1 | double, first z Cartesian coordinate | |
x2 | double, second x Cartesian coordinate | |
y2 | double, second y Cartesian coordinate | |
z2 | double, second z Cartesian coordinate |
create function fDistanceXyz(@x1 float, @y1 float, @z1 float, @x2 float, @y2 float, @z2 float) returns float as external name HTM.Sql.fDistanceXyz select dbo.fDistanceEq(0,0,0,0,0,1)
static SqlString Spherical.Htm.Sql.fHtmToString | ( | SqlInt64 | HtmID | ) | [static] |
fHtmToString(HtmID) returns varchar(max)a string describing the HtmID
HtmID | the ID to be translated |
create function fHtmToString(HtmID) returns varchar(max) as external name HTM.Sql.fHtmToString print dbo.fHtmToString(dbo.fHtmXyz(1,0,0))
static IEnumerable Spherical.Htm.Sql.fHtmLatLonToXyz | ( | SqlDouble | lat, | |
SqlDouble | lon | |||
) | [static] |
XyzTable(x,y,z) fHtmLatLonToXyz(lat, lon) converts an lat,lon point to a table with one row containing the cartesian point (x,y,z).
lat | double, latitude coordinate (degrees) | |
lon | double, longitude coordinate (degrees) |
create function fHtmLatLonToXyz(lat float, lon float) returns VertexTable(x float, y float, z float) as external name HTM.Sql.fHtmLatLonToXyz select * from fHtmLatLonToXyz(115, 38)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmEqToXyz | ( | SqlDouble | ra, | |
SqlDouble | dec | |||
) | [static] |
XyzTable(x,y,z) fHtmEqToXyz(ra, dec) converts an equitorial point to a table with one row containing the cartesian point (x,y,z).
ra | double, right ascencion coordinate (degrees) | |
dec | double, declination coordinate (degrees) |
create function fHtmEqXyz(lat float, lon float) returns VertexTable(x float, y float, z float) as external name HTM.Sql.fHtmEqToXyz select * from fHtmEqToXyz(115, 38)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmXyzToLatLon | ( | SqlDouble | x, | |
SqlDouble | y, | |||
SqlDouble | z | |||
) | [static] |
LatLonTable(lat,lon) fHtmXyzToLatLon(x,y,z) converts the cartesian point (x,y,z) to a table with one row containing the equivalent lat,lon point.
x | double, unit vector cartesian "x" | |
y | double, unit vector cartesian "x" | |
z | double, unit vector cartesian "x" |
create function fHtmXyzToEq(x float, y float, z float) returns LatLonTable(lat float, lon float) as external name HTM.Sql.fHtmXyzToLatLon select * from fHtmXyzToLatLon(1,0,0)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmXyzToEq | ( | SqlDouble | x, | |
SqlDouble | y, | |||
SqlDouble | z | |||
) | [static] |
EqTable(ra, dec) fHtmXyzToEq(x,y,z) converts the cartesian point (x,y,z) to a table with one row containing the equivalent equitorial (ra,dec) point.
x | double, unit vector cartesian "x" | |
y | double, unit vector cartesian "x" | |
z | double, unit vector cartesian "x" |
create function fHtmXyzToEq(x float, y float, z float) returns EqTable(ra float, dec float) as external name HTM.Sql.fHtmXyzToEq select * from fHtmXyzToEq(1,0,0)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmToCenterPoint | ( | SqlInt64 | HtmID | ) | [static] |
fHtmToCenterPoint(HtmID) converts an HTM triangle ID to an (x,y,z) vector of the HTM triangle centerpoint.
and returns that vector as the only row of a table.
HtmID | long: the htm ID of the triangle. an unsigned bigint. |
create function fHtmToCenterPoint(@htmID bigint.) returns VertexTable(x float, y float, z float) as external name HTM.Sql.fHtmToCenterPoint select * from fHtmToCenterPoint(dbo.fHtmXyz(.57735,.57735,.57735)) <br> gives: 0.577350269189626, 0.577350269189626, 0.577350269189626
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmToCornerPoints | ( | SqlInt64 | HtmID | ) | [static] |
fHtmToCornerPoints(HtmID) converts an HTM triangle ID to an table of three (x,y,z) vectors of the HTM triangle corners.
HtmID | long: the htm ID of the triangle. an unsigned bigint. |
create function fHtmTovertices(@htmID bigint.) returns VertexTable(x float, y float, z float) as external name HTM.Sql.fHtmTovertices select * from fHtmToCornerPoints(8) gives: x y z 1 0 0 0 0 -1 0 1 0
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverCircleLatLon | ( | SqlDouble | lat, | |
SqlDouble | lon, | |||
SqlDouble | radiusArcMin | |||
) | [static] |
fHtmCoverCircleLatLon(ra,dec,radiusArcMin) returns a trixel table (a list) covering
the circle centered at that lat,lon, within that arc-minute radius.
A trixel table is a list of HtmIDStart,HtmIDEnd pairs that describe
the HTM triangles (all points of a triangle are between its HtmIDStart and HtmIDEnd.
lat | double, latitude of centerpoint (degrees) | |
lon | double, longitude of centerpoint (degrees) | |
radiusArcMin | double, radius in arcminutes |
create function fHtmCoverCircleLatLon(@lat float, @lon float, @radiusArcMin float) returns bigint as external name HTM.Sql.fHtmCoverCircleLatLon select * from fHtmCoverCircLatLon(5,195,1)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverCircleEq | ( | SqlDouble | ra, | |
SqlDouble | dec, | |||
SqlDouble | radiusArcMin | |||
) | [static] |
fHtmCoverCircleEq(ra,dec,radiusArcMin) returns a trixel table (a list) covering
the circle centered at that J2000 ra,dec, within that arc-minute radius.
A trixel table is a list of HtmStart,HtmStop pairs that describe
the HTM triangles (all points of a triangle are between its HtmStart and HtmStop.
ra | double, right ascencion of centerpoint (degrees) | |
dec | double, declination of centerpoint (degrees) | |
radiusArcMin | double, radius in arcminutes |
create function fHtmCoverCircleEq(@ra float, @dec float, @radiusArcMin float) returns bigint as external name HTM.Sql.fHtmCoverCircleEq
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverCircleXyz | ( | SqlDouble | x, | |
SqlDouble | y, | |||
SqlDouble | z, | |||
SqlDouble | radiusArcMin | |||
) | [static] |
fHtmCoverCircleXyz(x,y,z,radiusArcMin) returns a trixel table (a list) covering
the circle centered at that x,y,z, within that arc-minute radius.
A trixel table is a list of HtmIDStart,HtmIDEnd pairs that describe
the HTM triangles (all points of a triangle are between its HtmIDStart and HtmIDEnd.
x | double, x Cartesian coordinate of centerpoint | |
y | double, y Cartesian coordinate of centerpoint | |
z | double, z Cartesian coordinate of centerpoint | |
radiusArcMin | double, radius in arcminutes |
create function fHtmCoverCircleXyz(@x float, @y float, @z float, @radiusArcMin float) returns bigint as external name HTM.Sql.fHtmCoverCircleXyz declare @HtmID bigint select * from fHtmCoverCircleXyz(1,0,0,1)
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverList | ( | SqlString | coverspec | ) | [static] |
fHtmCoverList(regionspec) returns a list of HtmID's that describe the HTM triangles covering the region.
coverspec | a string satisfying the region syntax |
create function fHtmCoverList(@region nvarchar(max)) returns table (HtmID bigint) as external name HTM.Sql.fHtmCoverList select * from fHtmCoverList('CIRCLE J2000 195 0 1')
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverRegionSelect | ( | SqlString | coverspec, | |
SqlString | kind | |||
) | [static] |
fHtmCoverRegionSelect(regionspec) returns a the qualified list of HtmIDStart,HtmIDEnd pairs
that describe the level 20 trixels covering the region.
coverspec | a string satisfying the region syntax | |
kind | "Partial", "Full" or "Both" |
create function fHtmCoverRegionSelect(@region nvarchar(max), @kind nvarchar(max)) returns table (HtmIDstart bigint, HtmIDend bigint) as external name HTM.Sql.fHtmCoverRegionSelect select * from fHtmCoverRegionSelect('CIRCLE J2000 195 0 1', 'full')
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverRegion | ( | SqlString | coverspec | ) | [static] |
fHtmCoverRegion(region) returns a list of HtmStart,HtmStop pairs
that describe the HTM triangles covering the region.
coverspec | a string satisfying the region syntax |
create function fHtmCoverRegion(@region nvarchar(max)) returns table (HtmIDstart bigint, HtmIDend bigint) as external name HTM.Sql.fHtmCover select * from fHtmCoverRegion('CIRCLE J2000 195 0 1')
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmCoverTypedRegion | ( | SqlString | coverspec | ) | [static] |
fHtmCoverTypedRegion(region) returns a list of HtmStart,HtmStop pairs
that describe the HTM triangles covering the region. Full and Partial triangles. are treated separately.
coverspec | a string satisfying the region syntax |
create function fHtmCoverTypedRegion(@region nvarchar(max)) returns table (HtmIDstart bigint, HtmIDend bigint, flag smallint) as external name HTM.Sql.fHtmCover select * from fHtmCoverTypedRegion('CIRCLE J2000 195 0 1')
--------------------------------------------------------------
static IEnumerable Spherical.Htm.Sql.fHtmRegionToTable | ( | SqlString | coverspec | ) | [static] |
fHtmRegionToTable(region) converts a region definiton a table of halfspaces
coverspec | a string satisfying the region syntax |
create function fHtmRegionToTable(@region nvarchar(max)) returns table (convexid int, halfspaceid int, x double, y double, z double, D double) as external name HTM.Sql.fHtmRegionToTable select * from dbo.fHtmRegionToTable('CIRCLE J2000 195 0 1')
--------------------------------------------------------------
static SqlString Spherical.Htm.Sql.fHtmRegionToNormalFormString | ( | SqlString | coverspec | ) | [static] |
fHtmRegionToNormalFormString(coverspec) converts a region definiton to normal form
coverspec | a string satisfying the region syntax regionSpec := REGION {areaSpec}* | areaSpec circleSpec := CIRCLE J2000 ra dec radArcMin | CIRCLE LATLON lat lon radArcMin | CIRCLE [CARTESIAN ] x y z radArcMin rectSpec := RECT LATLON {lat lon}2 | RECT J2000 {ra dec }2 | RECT [CARTESIAN ] {x y z }2 polySpec := POLY LATLON {lat lon}3+ | POLY J2000 {ra dec }3+ | POLY [CARTESIAN ] {x y z }3+ hullSpec := CHULL LATLON {lat lon}3+ | CHULL J2000 {ra dec }3+ | CHULL [CARTESIAN ] {x y z }3+ convexSpec := CONVEX LATLON {lat lon}* | CONVEX J2000 {ra dec }* | CONVEX [CARTESIAN ]{x y z }* areaSpec := circleSpec | rectSpec | polySpec | hullSpec | convexSpec |
create function fHtmRegionToNormalFormString(@region nvarchar(max)) returns table (HtmID_start bigint, HtmID_end bigint) as external name HTM.Sql.fHtmToNormalForm select dbo.fHtmRegionToNormalFormString('CIRCLE J2000 195 0 1')
--------------------------------------------------------------
static SqlString Spherical.Htm.Sql.fHtmRegionError | ( | SqlString | coverspec | ) | [static] |
fHtmRegionError(coverspec) returns diagnostic message appropriate for a bad region string
coverspec | a string satisfying the region syntax |
create function fHtmRegionError(@region nvarchar(max)) returns varchar(max) as external name HTM.Sql.fHtmRegionError print dbo.fHtmRegionError('CIRCLE LATLON 195 ')
--------------------------------------------------------------