orbittest

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package orbittest is what orbit's tests and gpu/orbit's share: a centre to orbit, the closed forms of a point mass's orbits, and how well a run of steps resolves one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apocentre

func Apocentre(gm, axis, eccentricity float64) (far, speed float64)

Apocentre is an orbit's farthest point from a gm and its speed there, for a semi-major axis and an eccentricity.

func Centre

func Centre(suns float64) grav.Body

Centre is a point mass of so many suns. It panics on a mass no point can have, since a test with no centre has nothing to run.

func Circular

func Circular(gm, radius float64) float64

Circular is the speed of a circular orbit at a radius about a gm.

func Energies

func Energies(gm, speed, distance float64) (moving, pulled float64)

Energies is the two parts of that energy, each positive: the energy of the star's motion, and the size of the energy of its place in the field. Their difference is the energy.

Their sum is what a drift in the energy is held against: the two can nearly cancel while each is large, and a drift small against either is then large against the difference.

func Energy

func Energy(gm, speed, distance float64) float64

Energy is a star's energy for each unit of its mass in a point mass's field, in kilometres per second squared, at a speed and a distance.

func Half

func Half(period float64) float64

Half is half a period.

func Pericentre

func Pericentre(gm, axis, eccentricity float64) (near, speed float64)

Pericentre is an orbit's nearest point to the centre and its speed there, for a semi-major axis and an eccentricity.

func Period

func Period(gm, axis float64) float64

Period is the period of an orbit of a semi-major axis about a gm, in units of time.

func Resolved

func Resolved(gm, speed, near, dt, factor, floor float64) float64

Resolved is how well steps of a length resolve an orbit about a gm at its nearest pass: a factor times the square of the step's share of the pass in the star's motion plus its share in the pull, and a floor under it. The leapfrog's errors are of this size.

func Room

func Room(moved, pulled, factor, floor float64) float64

Room is how well a pass with the step's shares is resolved, as Resolved measures it, for any field: a factor times the square of the share in the motion plus the share in the pull, and a floor under it. It is what a pass's own shares from Pass.Steps give.

func Shares

func Shares(gm, speed, near, dt float64) (moved, pulled float64)

Shares is the step's shares of a pass about a gm, at a speed and a distance, for steps of a length: how far the star moves in one step and how far the pull moves it over one step squared, each as a share of the distance.

It is what orbit's Pass.Steps reports, from the point mass's closed form.

func Size

func Size(x, y, z float64) float64

Size is the length of a triple.

func Within

func Within(got, want, room float64) bool

Within says whether a number is within room of another.

Types

This section is empty.

Jump to

Keyboard shortcuts

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