convert

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

https://en.wikipedia.org/wiki/ICAO_airport_code#Prefixes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AngleDifference added in v0.3.6

func AngleDifference(from, to float64) float64

AngleDifference returns the shortest signed angular difference from → to, in degrees, in the range (-180, 180]. Positive = clockwise (to is to the right of from). Negative = counter-clockwise (to is to the left of from).

func CelsiusToFahrenheit added in v0.3.5

func CelsiusToFahrenheit(c float64) float64

func CelsiusToKelvin added in v0.3.5

func CelsiusToKelvin(c float64) float64

func DegreesToRadians

func DegreesToRadians(deg float64) float64

func FahrenheitToCelsius added in v0.3.5

func FahrenheitToCelsius(f float64) float64

func FahrenheitToKelvin added in v0.3.5

func FahrenheitToKelvin(f float64) float64

func FeetPerMinuteToFeetPerSecond

func FeetPerMinuteToFeetPerSecond(fpm float64) float64

func FeetPerMinuteToMetersPerSecond

func FeetPerMinuteToMetersPerSecond(fpm float64) float64

FeetPerMinuteToMetersPerSecond converts vertical speed from ft/min to m/s. Exact factor: 0.3048 m/ft ÷ 60 s/min = 0.00508 m/s per ft/min.

func FeetPerSecondToFeetPerMinute

func FeetPerSecondToFeetPerMinute(fps float64) float64

func FeetPerSecondToKnots added in v0.3.6

func FeetPerSecondToKnots(fps float64) float64

func FeetToMeters

func FeetToMeters(feet float64) float64

func HectopascalToInHg added in v0.3.5

func HectopascalToInHg(hPa float64) float64

HectopascalToInHg is an alias for MillibarToInHg since 1 hPa = 1 mbar.

func ICAOCountry

func ICAOCountry(code string) string

ICAOCountry returns the country or territory for a given ICAO code (first two letters)

func ICAORegion

func ICAORegion(code string) string

ICAORegion returns the region for a given ICAO code (first letter)

func InHgToHectopascal added in v0.3.5

func InHgToHectopascal(inHg float64) float64

InHgToHectopascal is an alias for InHgToMillibar since 1 mbar = 1 hPa.

func InHgToMillibar added in v0.3.5

func InHgToMillibar(inHg float64) float64

func InHgToPascal added in v0.3.5

func InHgToPascal(inHg float64) float64

func IsICAOCode

func IsICAOCode(code string) bool

IsICAOCode returns true if the code is a valid ICAO airport code prefix (not a full registry check).

func KelvinToCelsius added in v0.3.5

func KelvinToCelsius(k float64) float64

func KelvinToFahrenheit added in v0.3.5

func KelvinToFahrenheit(k float64) float64

func KilogramsToPounds added in v0.3.5

func KilogramsToPounds(kg float64) float64

func KilometersPerHourToKnots

func KilometersPerHourToKnots(kph float64) float64

func KilometersPerHourToMach

func KilometersPerHourToMach(kph float64) float64

func KilometersToMeters

func KilometersToMeters(km float64) float64

func KilometersToNM

func KilometersToNM(km float64) float64

func KilometersToStatuteMiles added in v0.3.6

func KilometersToStatuteMiles(km float64) float64

func KnotsToFeetPerSecond added in v0.3.6

func KnotsToFeetPerSecond(knots float64) float64

func KnotsToKilometersPerHour

func KnotsToKilometersPerHour(knots float64) float64

func KnotsToMach

func KnotsToMach(knots float64) float64

func KnotsToMetersPerSecond

func KnotsToMetersPerSecond(knots float64) float64

func LatLonToOffset added in v0.4.1

func LatLonToOffset(latRef, lonRef, lat, lon float64) (xEast, zNorth float64)

LatLonToOffset is the inverse of OffsetToLatLon. Given a reference point (latRef, lonRef in decimal degrees) and a target point (lat, lon in decimal degrees), it returns the east (xEast) and north (zNorth) meter offsets of the target from the reference point using the WGS84 ellipsoid.

Parameter order matches OffsetToLatLon for symmetry:

xEast, zNorth := LatLonToOffset(latRef, lonRef, lat, lon)
lat2, lon2    := OffsetToLatLon(latRef, lonRef, xEast, zNorth)
// lat2 ≈ lat, lon2 ≈ lon (within floating-point precision)

Pole guard: when math.Abs(latRef) >= 90, the eastward direction is undefined; xEast is returned as 0 to avoid a division-by-zero singularity.

func LitersToUSGallons added in v0.3.5

func LitersToUSGallons(l float64) float64

func MachToKilometersPerHour

func MachToKilometersPerHour(mach float64) float64

func MachToKnots

func MachToKnots(mach float64) float64

func MetersPerSecondToFeetPerMinute

func MetersPerSecondToFeetPerMinute(ms float64) float64

func MetersPerSecondToKnots

func MetersPerSecondToKnots(ms float64) float64

func MetersToFeet

func MetersToFeet(meters float64) float64

func MetersToKilometers

func MetersToKilometers(meters float64) float64

func MetersToNM

func MetersToNM(meters float64) float64

func MetersToStatuteMiles added in v0.3.6

func MetersToStatuteMiles(m float64) float64

func MillibarToInHg added in v0.3.5

func MillibarToInHg(mbar float64) float64

func NMToKilometers

func NMToKilometers(nm float64) float64

func NMToMeters

func NMToMeters(nm float64) float64

func NMToStatuteMiles added in v0.3.6

func NMToStatuteMiles(nm float64) float64

func NormalizeAngle added in v0.3.6

func NormalizeAngle(deg float64) float64

NormalizeAngle normalises an angle to (-180, 180]. Useful for signed bearing differences and track deviation calculations.

func NormalizeHeading

func NormalizeHeading(deg float64) float64

NormalizeHeading returns a heading in [0, 360).

func OffsetToLatLon

func OffsetToLatLon(latRef, lonRef, xEast, zNorth float64) (lat, lon float64)

OffsetToLatLon calculates the latitude and longitude of a point given a reference point (latRef, lonRef in degrees) and offsets X (east, meters) and Z (north, meters). At the geographic poles (latRef = ±90) eastward offset is undefined; deltaLon is forced to zero to avoid a division-by-zero singularity.

func PascalToInHg added in v0.3.5

func PascalToInHg(pa float64) float64

func PoundsToKilograms added in v0.3.5

func PoundsToKilograms(lbs float64) float64

func RadiansToDegrees

func RadiansToDegrees(rad float64) float64

func StatuteMilesToKilometers added in v0.3.6

func StatuteMilesToKilometers(mi float64) float64

func StatuteMilesToMeters added in v0.3.6

func StatuteMilesToMeters(mi float64) float64

func StatuteMilesToNM added in v0.3.6

func StatuteMilesToNM(mi float64) float64

func USGallonsToLiters added in v0.3.5

func USGallonsToLiters(gal float64) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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