RepositoryGo
joshuaferrara

joshuaferrara/go-satellite

Calculate orbital information of satellites in GoLang.

101stars
34forks
10issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: julian

#1 Repository of the month

1
TINIX TRENDING·Topic: sgp4

#1 Repository of the month

1
TINIX TRENDING·Topic: sgp

#1 Repository of the month

satellite

import "github.com/joshuaferrara/go-satellite"

Intro

Go GoDoc

I decided to port the SGP4 library to GoLang as one of my first projects with the language. I've included a test suite to ensure accuracy.

Usage

Constants

const DEG2RAD float64 = math.Pi / 180.0
const RAD2DEG float64 = 180.0 / math.Pi
const TWOPI float64 = math.Pi * 2.0
const XPDOTP float64 = 1440.0 / (2.0 * math.Pi)

func ECIToLLA

func ECIToLLA(eciCoords Vector3, gmst float64) (altitude, velocity float64, ret LatLong)

Convert Earth Centered Inertial coordinated into equivalent latitude, longitude, altitude and velocity. Reference: http://celestrak.com/columns/v02n03/

func GSTimeFromDate

func GSTimeFromDate(year, mon, day, hr, min, sec int) float64

Calc GST given year, month, day, hour, minute and second

func JDay

func JDay(year, mon, day, hr, min, sec int) float64

Calc julian date given year, month, day, hour, minute and second the julian date is defined by each elapsed day since noon, jan 1, 4713 bc.

func Propagate

func Propagate(sat Satellite, year int, month int, day, hours, minutes, seconds int) (position, velocity Vector3)

Calculates position and velocity vectors for given time

func ThetaG_JD

func ThetaG_JD(jday float64) (ret float64)

Calculate GMST from Julian date. Reference: The 1992 Astronomical Almanac, page B6.

type LatLong

type LatLong struct {
	Latitude, Longitude float64
}

Holds latitude and Longitude in either degrees or radians

func LatLongDeg

func LatLongDeg(rad LatLong) (deg LatLong)

Convert LatLong in radians to LatLong in degrees

type LookAngles

type LookAngles struct {
	Az, El, Rg float64
}

Holds an azimuth, elevation and range

func ECIToLookAngles

func ECIToLookAngles(eciSat Vector3, obsCoords LatLong, obsAlt, jday float64) (lookAngles LookAngles)

Calculate look angles for given satellite position and observer position obsAlt in km Reference: http://celestrak.com/columns/v02n02/

type Satellite

type Satellite struct {
	Line1 string
	Line2 string
}

Struct for holding satellite information during and before propagation

func ParseTLE

func ParseTLE(line1, line2 string, gravConst Gravity) (sat Satellite)

Parses a two line element dataset into a Satellite struct

func TLEToSat

func TLEToSat(line1, line2 string, gravConst Gravity) Satellite

Converts a two line element data set into a Satellite struct and runs sgp4init

type Vector3

type Vector3 struct {
	X, Y, Z float64
}

Holds X, Y, Z position

func ECIToECEF

func ECIToECEF(eciCoords Vector3, gmst float64) (ecfCoords Vector3)

Convert Earth Centered Intertial coordinates into Earth Cenetered Earth Final coordinates Reference: http://ccar.colorado.edu/ASEN5070/handouts/coordsys.doc

func LLAToECI

func LLAToECI(obsCoords LatLong, alt, jday float64) (eciObs Vector3)

Convert latitude, longitude and altitude into equivalent Earth Centered Intertial coordinates Reference: The 1992 Astronomical Almanac, page K11.

func NewSpacetrack

func NewSpacetrack(username, password string) *Spacetrack

Initialise a spacetrack API for fetching TLEs

func Spacetrack.GetTLE()

func (s *Spacetrack) GetTLE(catid uint64, ts time.Time, gravConst Gravity) (Satellite, error)

Get an initialized Satellite based on the latest TLE before the given time.

Similar Projects

Discover other similar projects and AI models.

RepositoryKotlin
Hamza417/Positional

An elegant and colorful location information app for Android with Compass, Clock, Level, Sun, Moon, Trail Marker and many other features.

297
May 12, 2026
RepositoryGo
avelino/awesome-go

A curated list of awesome Go frameworks, libraries and software

197.2k
Dec 2, 2026
RepositoryGo
ollama/ollama

Get up and running with Inkling, Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

188.9k
Dec 2, 2026
RepositoryC++
Cultrarius/Swarmz

A free, header-only C++ swarming (flocking) library for real-time applications

141
Oct 31, 2019
RepositoryC++
Edubgr/MPU6050-MotionTracking

Movement data collection using MPU6050 and Raspberry Pi. And obtaining the position and velocity with Python and Matplotlib, with visualization and data processing.

116
Nov 3, 2021
RepositoryPython
practical-tutorials/project-based-learning

Curated list of project-based tutorials

290.9k
Nov 30, 2026
RepositoryGo
golang/go

The Go programming language

140.0k
Dec 1, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryPython
yt-dlp/yt-dlp

A feature-rich command-line audio/video downloader

212.4k
Dec 2, 2026