Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CentralGravityR2 ¶
type CentralGravityR2 struct { // Centre represents the centre of this gravitational force. Centre r2.Vec // GravitationalConstant represents the strength of gravity. GravitationalConstant float64 }
func NewCentralGravityR2 ¶
func NewCentralGravityR2( centre r2.Vec, gravitationalConstant float64) *CentralGravityR2
type ForceStack ¶
type ForceStack struct { // RandomizerSeed for random node location generation. // This enables reproducible results. RandomizerSeed uint64 // Updates represents the number of iterations that should be run. Updates uint // StepSize represents the distance each node may travel for every update. StepSize float64 // CoolingRate represents the decrease of the step size per update. CoolingRate float64 // StopThreshold represents the stopping criteria for the simulation. // Once the movements are small enough, the simulation stops. StopThreshold float64 // contains filtered or unexported fields }
func NewForceStack ¶
func (*ForceStack) AddForce ¶
func (s *ForceStack) AddForce(force Force)
type SimpleMassNode ¶
type SpringElectricalR2 ¶
type SpringElectricalR2 struct { // OptimalDistance represents parameter K in the paper. OptimalDistance float64 // RepulsionStrength represents the regularization parameter C in the paper. RepulsionStrength float64 // RepulsionExponent represents parameter p (p > 0) for the repulsive force to reduce distortion effects. // Default should be 1. This exponent is part of the denominator. Increasing it reduces the applied force. RepulsionExponent uint // AttractionExponent is an added parameter for the attractive spring force to regulate its effect. // Default should be 1.0. This exponent is part of the numerator. Increasing it increases the applied force. AttractionExponent float64 // Epsilon is the threshold for small forces. Every force below this value will be omitted. Epsilon float64 }
func NewSpringElectricalR2 ¶
Click to show internal directories.
Click to hide internal directories.