coordinates

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package coordinates provides functions for coordinate transformations between geodetic, ECEF, ENU, and body frames, including ionospheric pierce point calculations.

Index

Constants

View Source
const (
	EarthEquatorialRadius    = 6378137.0                               // Earth's equatorial radius in meters
	EarthFlattening          = 1.0 / 298.257223563                     // Earth's flattening factor
	EarthEccentricitySquared = EarthFlattening * (2 - EarthFlattening) // Square of Earth's eccentricity
)

Earth constants for the WGS84 ellipsoid

View Source
const (
	IonosphereAltitude = 350000.0                                   // Ionospheric altitude above Earth's surface in meters
	IonosphereRadius   = EarthEquatorialRadius + IonosphereAltitude // Ionospheric shell radius
)

Constants for the ionospheric shell

Variables

This section is empty.

Functions

func ComputeAzimuthElevation

func ComputeAzimuthElevation(receiverECEF, satelliteECEF Vector3D) (azimuthDeg, elevationDeg float64)

ComputeAzimuthElevation calculates the azimuth and elevation (in degrees) of a satellite from a receiver position. Inputs are receiver and satellite positions in ECEF coordinates.

func ComputeECEFToENUTransform

func ComputeECEFToENUTransform(geoCoord GeodeticCoord) *mat.Dense

ComputeECEFToENUTransform computes the transformation matrix from ECEF to ENU coordinates at a given geodetic position.

func ComputeRACTransform

func ComputeRACTransform(satPosition, satVelocity Vector3D) (*mat.Dense, error)

ComputeRACTransform calculates the rotation matrix from ECEF to Radial-AlongTrack-CrossTrack (RAC) frame.

func DegToRad

func DegToRad(degrees float64) float64

DegToRad converts degrees to radians.

func DotProduct

func DotProduct(a, b Vector3D) float64

DotProduct computes the dot product of two Vector3 vectors.

func Norm

func Norm(a Vector3D) float64

Norm computes the Euclidean norm of a Vector3 vector.

func RadToDeg

func RadToDeg(radians float64) float64

RadToDeg converts radians to degrees.

Types

type GeodeticCoord

type GeodeticCoord struct {
	Latitude  float64 // in radians
	Longitude float64 // in radians
	Height    float64 // in meters
}

GeodeticCoord represents geodetic coordinates with latitude and longitude in radians.

func ComputeIonoPiercePointGeodetic

func ComputeIonoPiercePointGeodetic(receiverECEF, satelliteECEF Vector3D) (GeodeticCoord, error)

ComputeIonoPiercePointGeodetic calculates the Ionospheric Pierce Point (IPP) in geodetic coordinates given receiver and satellite positions in ECEF coordinates.

func ECEFToGeodetic

func ECEFToGeodetic(ecef Vector3D) GeodeticCoord

ECEFToGeodetic converts ECEF coordinates to geodetic coordinates.

func (GeodeticCoord) MarshalJSON

func (g GeodeticCoord) MarshalJSON() ([]byte, error)

MarshalJSON customizes the JSON encoding of GeodeticCoord to use degrees for latitude and longitude.

type Vector3D

type Vector3D [3]float64

Vector3D represents a 3D vector.

func Add

func Add(a, b Vector3D) Vector3D

Add computes the sum of two vectors a and b.

func ComputeIonoPiercePointECEF

func ComputeIonoPiercePointECEF(receiverECEF, satelliteECEF Vector3D) (Vector3D, error)

ComputeIonoPiercePointECEF calculates the Ionospheric Pierce Point (IPP) in ECEF coordinates given receiver and satellite positions in ECEF coordinates.

func CrossProduct

func CrossProduct(a, b Vector3D) Vector3D

CrossProduct computes the cross product of two Vector3 vectors.

func ECEFToENU

func ECEFToENU(geoCoord GeodeticCoord, ecefVec Vector3D) Vector3D

ECEFToENU converts an ECEF vector to ENU coordinates at a given geodetic position.

func ENUToECEF

func ENUToECEF(geoCoord GeodeticCoord, enuVec Vector3D) Vector3D

ENUToECEF converts an ENU vector to ECEF coordinates at a given geodetic position.

func GeodeticToECEF

func GeodeticToECEF(geoCoord GeodeticCoord) Vector3D

GeodeticToECEF converts geodetic coordinates to ECEF coordinates.

func MultiplyVectorByScalar

func MultiplyVectorByScalar(a Vector3D, scalar float64) Vector3D

MultiplyVectorByScalar multiplies a Vector3 by a scalar.

func Subtract

func Subtract(a, b Vector3D) Vector3D

Subtract computes the difference between two vectors a and b (a - b).

func (*Vector3D) IsZero

func (v *Vector3D) IsZero() bool

Jump to

Keyboard shortcuts

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