bancroft

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Example
satelliteData := []SatelliteData{
	{X: 2.1546807365131136e+06, Y: -2.2968003807721183e+07, Z: 1.3207092299581166e+07, Range: 2.1591680307887416e+07},
	{X: -6.482073650073023e+06, Y: -1.7211413456558973e+07, Z: 1.919328381253781e+07, Range: 2.030607210838098e+07},
	{X: -1.2712683856435608e+07, Y: -2.3181786002204232e+07, Z: -1.1388682566721998e+06, Range: 2.2798205644901376e+07},
	{X: -1.9601479202481702e+07, Y: -1.1386891072686208e+07, Z: 1.4045625556585612e+07, Range: 2.1089551125442293e+07},
	{X: -1.3935824110050576e+07, Y: -1.3407357919161396e+07, Z: 1.8304461276211735e+07, Range: 2.038270482901769e+07},
	{X: 1.2078617745816926e+07, Y: -9.433176443212371e+06, Z: 2.15947496964344e+07, Range: 2.303489958533048e+07},
	{X: 1.6082935011882955e+07, Y: -1.8864877189759843e+07, Z: 9.749707762208622e+06, Range: 2.444856600665699e+07},
	{X: 1.687341380783716e+07, Y: -1.5810291346207444e+07, Z: 1.2679983194221094e+07, Range: 2.4142704966374166e+07},
	{X: -1.618345006776886e+07, Y: -1.760555262675183e+06, Z: 2.0827394938127756e+07, Range: 2.138124385364741e+07},
	{X: -1.0971179346733421e+07, Y: 1.1126104761998503e+07, Z: 2.0979186831871327e+07, Range: 2.3688749991210185e+07},
	{X: -2.4981906022296138e+07, Y: 6.036589673330338e+06, Z: 6.715982984329175e+06, Range: 2.4692496203296583e+07},
}

x, y, z, dt, err := CalculatePosition(satelliteData)
if err != nil {
	log.Fatalf("Failed to calculate position: %v", err)
}

fmt.Printf("pos: x=%.3f, y=%.3f, z=%.3f, dt=%e\n", x, y, z, dt)
Output:

Index

Examples

Constants

View Source
const SPEED_OF_LIGHT = 299792458.0

Variables

This section is empty.

Functions

func CalculatePosition

func CalculatePosition(satelliteData []SatelliteData) (x, y, z, dt float64, err error)

CalculatePosition uses the Bancroft method to calculate the receiver's position

Types

type SatelliteData

type SatelliteData struct {
	X, Y, Z float64
	Range   float64
}

SatelliteData holds satellite position and pseudorange

Jump to

Keyboard shortcuts

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