units

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const AUToKm = 149597870.7

AUToKm is the IAU 2012 nominal astronomical unit in kilometers.

Variables

This section is empty.

Functions

This section is empty.

Types

type Angle

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

Angle represents an angular measurement.

func AngleFromDegrees

func AngleFromDegrees(deg float64) Angle

AngleFromDegrees creates an Angle from degrees.

func AngleFromHours

func AngleFromHours(hours float64) Angle

AngleFromHours creates an Angle from hours of right ascension.

func NewAngle

func NewAngle(radians float64) Angle

NewAngle creates an Angle from radians.

func (Angle) Arcminutes

func (a Angle) Arcminutes() float64

Arcminutes returns the angle in arcminutes.

func (Angle) Arcseconds

func (a Angle) Arcseconds() float64

Arcseconds returns the angle in arcseconds.

func (Angle) DMS

func (a Angle) DMS() (sign float64, deg, min int, sec float64)

DMS decomposes the angle into sign, integer degrees, integer arcminutes, and fractional arcseconds. Sign is +1 or -1.

func (Angle) Degrees

func (a Angle) Degrees() float64

Degrees returns the angle in degrees.

func (Angle) HMS

func (a Angle) HMS() (sign float64, hours, min int, sec float64)

HMS decomposes the angle (as right ascension) into sign, integer hours, integer minutes, and fractional seconds. Sign is +1 or -1.

func (Angle) Hours

func (a Angle) Hours() float64

Hours returns the angle in hours of right ascension.

func (Angle) Radians

func (a Angle) Radians() float64

Radians returns the angle in radians.

type Distance

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

Distance represents a distance measurement.

func DistanceFromAU

func DistanceFromAU(au float64) Distance

DistanceFromAU creates a Distance from astronomical units.

func DistanceFromMeters

func DistanceFromMeters(m float64) Distance

DistanceFromMeters creates a Distance from meters.

func NewDistance

func NewDistance(km float64) Distance

NewDistance creates a Distance from kilometers.

func (Distance) AU

func (d Distance) AU() float64

AU returns the distance in astronomical units.

func (Distance) Km

func (d Distance) Km() float64

Km returns the distance in kilometers.

func (Distance) LightSeconds

func (d Distance) LightSeconds() float64

LightSeconds returns the distance in light-seconds.

func (Distance) M

func (d Distance) M() float64

M returns the distance in meters.

Jump to

Keyboard shortcuts

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