Documentation
¶
Index ¶
- Variables
- func AccelerationDistance(x0, v0, a, t *big.Rat) *big.Rat
- func AccelerationVelocity(v0, a, t *big.Rat) *big.Rat
- func AstronomicalUnit(au float64) *big.Rat
- func DistanceString(d *big.Rat) string
- func LightyearsToMeters(ly float64) *big.Rat
- func MetersToLightyears(x *big.Rat) float64
- func PercentCToVelocity(pct float64) *big.Rat
- func TimeString(dur time.Duration) string
- func ToAstronomicalUnit(x *big.Rat) *big.Rat
- func VelocityToPercentC(v *big.Rat) float64
- type Clock
- type State
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AccelerationDistance ¶
AccelerationDistance computes the distance traveled during an acceleration.
func AccelerationVelocity ¶
AccelerationVelocity computes the final velocity after an acceleration.
func AstronomicalUnit ¶
AstronomicalUnit return the number of meters for a given number of AU.
func DistanceString ¶
DistanceString prints out the distance in a human-readable form.
func LightyearsToMeters ¶
LightyearsToMeters convert lightyears to meters.
func MetersToLightyears ¶
MetersToLightyears converts meters to lightyears.
func PercentCToVelocity ¶
PercentCToVelocity computes the velocity in m/s from a percent of lightspeed.
func TimeString ¶
TimeString prints out a time duration in a human-readable form. The Go stdlib version stops at seconds, but for printing clock drift, we'll need to go further.
func ToAstronomicalUnit ¶
ToAstronomicalUnit converts a distance in meters to AU.
func VelocityToPercentC ¶
VelocityToPercentC returns the percent lightspeed for a given velocity.
Types ¶
type State ¶
State tracks an object's velocity and position.
func (State) Accelerate ¶
Accelerate computes the state after an acceleration period.