Documentation ¶
Overview ¶
Package orbcore provides functions to work out orbital details for an asronomical object.
Index ¶
- Constants
- func Identity(size int) *mat.DiagDense
- func MeanMotionSteppedChannel(orbit *Orbit, timeStep time.Duration, count int64, output chan *Orbit)
- func OrbitToVecPerifocal(orbit *Orbit) (*mat.VecDense, *mat.VecDense)
- func OrbitToVector(orbit *Orbit) (mat.Vector, mat.Vector)
- func OrbitalPeriod(orbit *Orbit) time.Duration
- func QuickerRotationMatrixForOrbit(angleZ1, angleX, angleZ2 float64) *mat.Dense
- func Rotate(vec *mat.VecDense, angle float64, axis Axis) *mat.VecDense
- func RotationMatrix(angle float64, axis Axis) *mat.Dense
- func RotationMatrixForOrbit(angleZ1, angleX, angleZ2 float64) *mat.Dense
- func VectorToHelocentric(r mat.Vector, v mat.Vector) (mat.Vector, mat.Vector)
- type Axis
- type BoundingBox
- type BoundingBoxSplitter
- type Orbit
- type Position
Constants ¶
const ( AxisX Axis = 0 AxisY = 1 AxisZ = 2 )
Constants for three major axis
Variables ¶
This section is empty.
Functions ¶
func MeanMotionSteppedChannel ¶
func MeanMotionSteppedChannel(orbit *Orbit, timeStep time.Duration, count int64, output chan *Orbit)
MeanMotionSteppedChannel works like MeanMotionStepped except it puts the results down a channel rather than returning a list
func OrbitToVecPerifocal ¶
OrbitToVecPerifocal converts a MinorPlanet object into r and v vectors in the perifocal frame
func OrbitToVector ¶
OrbitToVector creates a vector representation from a MinorPlanet object
func OrbitalPeriod ¶
OrbitalPeriod returns the time taken for a complete orbit.
func QuickerRotationMatrixForOrbit ¶
QuickerRotationMatrixForOrbit builds a rotation matrix for an orbit by manually doing the matrix multiplication This is a lot faster than the RotationMatrixForOrbit.
func RotationMatrix ¶
RotationMatrix returns a rotation matrix for the given angle and axis Will panic if the axis is not one of AxisX, AxisY, AxisZ
func RotationMatrixForOrbit ¶
RotationMatrixForOrbit creates a rotation matrix that is the three rotations we need for sorting out an orbit vector Using this means we have to 4 matrix multiplications rather than 6
If this is in the hot path of your code consider using QuickerRotationMatrixForOrbit instead.
Types ¶
type BoundingBox ¶
type BoundingBox struct { MinX float64 MinY float64 MinZ float64 MinTime time.Time MaxX float64 MaxY float64 MaxZ float64 MaxTime time.Time }
BoundingBox defines a four dimensional bounding box in space and time.
func PositionsToBoundingBox ¶
func PositionsToBoundingBox(positions []*Position) *BoundingBox
PositionsToBoundingBox creates a bounding box around a set of positions.
func (*BoundingBox) Center ¶
func (bb *BoundingBox) Center() Position
Center returns the point in the center of this bounding box.
func (*BoundingBox) Contains ¶
func (bb *BoundingBox) Contains(pos *Position) bool
Contains returns true if the provided position is inside the box.
func (*BoundingBox) Corners ¶
func (bb *BoundingBox) Corners() [16]Position
Corners returns the 16 corners of our 4 dimensional bounding box.
func (*BoundingBox) Overlaps ¶
func (bb *BoundingBox) Overlaps(other *BoundingBox) bool
Overlaps returns true if the other bounding box overlaps this one.
func (*BoundingBox) String ¶
func (bb *BoundingBox) String() string
type BoundingBoxSplitter ¶
type BoundingBoxSplitter struct { Box *BoundingBox Center Position // contains filtered or unexported fields }
func NewBoundingBoxSplitter ¶
func NewBoundingBoxSplitter(box *BoundingBox) BoundingBoxSplitter
func (BoundingBoxSplitter) At ¶
func (bs BoundingBoxSplitter) At(i int) *BoundingBox
func (BoundingBoxSplitter) HasNext ¶
func (bs BoundingBoxSplitter) HasNext() bool
func (BoundingBoxSplitter) Next ¶
func (bs BoundingBoxSplitter) Next() *BoundingBox
type Orbit ¶
type Orbit struct { ID string ParentGrav float64 Epoch time.Time MeanAnomalyEpoch float64 // nu ArgumentOfPerihelion float64 // w argp LongitudeOfTheAscendingNode float64 // omega raan InclinationToTheEcliptic float64 // i inc OrbitalEccentricity float64 // e ecc MeanDailyMotion float64 SemimajorAxis float64 // a p }
Orbit holds required information for orbit calculations
func MeanMotion ¶
MeanMotion uses the mean motion method to propagate [orbit] through [t] seconds .
func MeanMotionFullOrbit ¶
MeanMotionFullOrbit will calculate a number of entries for a full orbit, divided into [count] steps
func MeanMotionStepped ¶
MeanMotionStepped calculates a mean motion value for [count] [timeStep]s and returns a list of orbits. Note: The first entry in the returned list will always be the starting orbit object.
func MeanMotionToDate ¶
MeanMotionToDate calculates the mean motion value for a defined date.
type Position ¶
Position contains information about the location in space of an object
func OrbitToPosition ¶
OrbitToPosition converts an object object to its position on day 0
func ParsePositionLine ¶
ParsePositionLine takes a CSV formatted line representing a possition and returns the object or an error
func ReadPositionFile ¶
ReadPositionFile opens a path an loads in a CSV formatted list of Positions
func ReadPositions ¶
ReadPositions takes a reader and parses a CSV formatted list of positions.