grav

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 2 Imported by: 2 modules, 2 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 grav describes bodies through their gravitational mass. The current Body stores mass and GM, enough for point-mass calculations.

Composition, age, spin, and radii derived from published structural models remain the design in doc/grav.md, not additional implemented constructors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	// contains filtered or unexported fields
}

Body stores a point mass and its gravitational parameter GM.

func Point

func Point(mass measure.Mass) (*Body, error)

Point constructs a body known only by mass, as a point-mass orbit sees it. The mass must be positive and finite; invalid input returns no body and an error.

func (Body) GM

func (body Body) GM() measure.Length

GM returns mass times G as a length in natural units: half the Schwarzschild horizon radius for that mass.

func (Body) Mass

func (body Body) Mass() measure.Mass

Mass returns the body's mass.

Jump to

Keyboard shortcuts

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