Documentation ¶
Overview ¶
Package dbscan clusters incoming points into clusters with params (eps, minPoints).
Index ¶
- Constants
- func DBScan(points clusters.PointList, eps float64, minPoints int) (clusterArray []clusters.Cluster, noise []int)
- func DistanceSpherical(p1, p2 space.Point) float64
- func DistanceSphericalFast(p1, p2 space.Point) float64
- func FastCos(x float64) float64
- func FastSine(x float64) float64
- func RegionQuery(points clusters.PointList, P space.Point, eps float64) []int
- type EpsFunction
- type KDTree
- type T
Constants ¶
const ( // DegreeRad is coefficient to translate from degrees to radians DegreeRad = math.Pi / 180.0 // EarthR is earth radius in km EarthR = 6371.0 )
const ...
Variables ¶
This section is empty.
Functions ¶
func DBScan ¶
func DBScan(points clusters.PointList, eps float64, minPoints int) (clusterArray []clusters.Cluster, noise []int)
DBScan clusters incoming points into clusters with params (eps, minPoints)
eps is clustering radius in km minPoints in minimum number of points in eps-neighborhood (density)
func DistanceSpherical ¶
DistanceSpherical is a spherical (optimized) distance between two points
Result is distance in kilometers
func DistanceSphericalFast ¶
DistanceSphericalFast calculates spherical distance with fast cosine without sqrt and normalization to Earth radius/radians
To get real distance in km, take sqrt and multiply result by EarthR*DegreeRad
In this library eps (distance) is adjusted so that we don't need to do sqrt and multiplication
func FastSine ¶
FastSine calculates sinus approximated to parabola
Taken from: http://forum.devmaster.net/t/fast-and-accurate-sine-cosine/9648
Types ¶
type EpsFunction ¶
EpsFunction is a function that returns eps based on point pt
type KDTree ¶
KDTree is implementation of K-D Tree, with Points separated from nodes.
Nodes (T) hold only indices into Points slice