points

package
v0.0.0-...-0456d50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Point

type Point struct {
	X, Y, Z   float64
	Neighbors struct {
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

func ClusteredPoint

func ClusteredPoint() *Point

func SpherePoint

func SpherePoint() *Point

func UniformPoint

func UniformPoint() *Point

func (*Point) AvgDistance

func (p *Point) AvgDistance() float64

func (*Point) DistanceTo

func (p *Point) DistanceTo(b *Point) float64

func (*Point) Scale

func (p *Point) Scale(n float64) *Point

type Points

type Points struct {
	Points []*Point
}

func NewPoints

func NewPoints(n int, pgen func() *Point) *Points

func (*Points) CullByCompanions

func (p *Points) CullByCompanions(n int) *Points

CullByCompanions culls out the systems that are closest to each other.

func (*Points) CullByDistanceFromOrigin

func (p *Points) CullByDistanceFromOrigin() *Points

CullByDistanceFromOrigin culls out the systems that are farthest from the origin

func (*Points) CullByMinDistance

func (p *Points) CullByMinDistance(min float64) *Points

CullByMinDistance culls out the systems that are closest to each other

func (*Points) Length

func (p *Points) Length() int

Length returns the number of points.

func (*Points) MinAvgMax

func (p *Points) MinAvgMax() (min, avg, max float64)

MinAvgMax returns the minimum, average, and maximum average distances between neighbors

func (*Points) SetNeighbors

func (p *Points) SetNeighbors(n int)

func (*Points) SortByDistanceDesc

func (p *Points) SortByDistanceDesc(n int) *Points

SortByDistanceDesc sorts the points by average distance from neighbors, descending. N is the number of neighbors to use for distance.

func (*Points) SortByDistanceOrigin

func (p *Points) SortByDistanceOrigin() *Points

SortByDistanceOrigin sorts the points by distance from origin, ascending.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL