Discover Packages
github.com/playbymail/empyr
pkg
internal
clusters
package
Version:
v0.0.0-...-76f73ec
Opens a new window with list of versions in this module.
Published: Apr 3, 2025
License: AGPL-3.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package clusters implements the cluster generation algorithm.
It returns a list of systems containing their coordinates
and the number of stars in each system. The location of the
3- and 4-star systems are fixed; the rest are randomly located.
type Point struct {
X, Y, Z int
}
DistanceBetween calculates the Euclidean distance between two points in 3D space.
Scale scales the point by a factor of scale, which should be the radius of the cluster.
String implements the fmt.Stringer interface.
TooClose returns true if the distance between a point and any
point in the slice of points is less than 5 units.
type System struct {
Coordinates Point
NumberOfStars int
}
func GenerateCluster() (systems []System )
GenerateCluster generates a slice containing 100 systems.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.