libwx

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToleranceExact = float64(0.0)
	Tolerance0     = float64(1.0)
	Tolerace1      = float64(0.1)
	Tolerance01    = float64(0.01)
	Tolerance001   = float64(0.001)
)

Variables

This section is empty.

Functions

func CurriedFloat64Compare added in v1.0.0

func CurriedFloat64Compare(tolerance float64) func(float64, float64) int

func CurriedFloat64Equal added in v1.0.0

func CurriedFloat64Equal(tolerance float64) func(float64, float64) bool

func Float64Compare added in v1.0.0

func Float64Compare(a, b, tolerance float64) int

func Float64Equal added in v1.0.0

func Float64Equal(a, b, tolerance float64) bool

func IntCompare added in v1.0.0

func IntCompare(a, b int) int

Types

type Km added in v1.0.0

type Km float64

Km represents distance in kilometers.

func (Km) Meters added in v1.0.1

func (km Km) Meters() Meter

Meters returns the distance in meters.

func (Km) Miles added in v1.0.0

func (km Km) Miles() Mile

Miles returns the distance in miles.

func (Km) NauticalMiles added in v1.0.0

func (km Km) NauticalMiles() NauticalMile

NauticalMiles returns the distance in nautical miles.

func (Km) Unwrap added in v1.0.0

func (km Km) Unwrap() float64

type Meter added in v1.0.1

type Meter float64

Meter represents distance in meters.

func (Meter) Km added in v1.0.1

func (m Meter) Km() Km

Km returns the distance in kilometers.

func (Meter) Miles added in v1.0.1

func (m Meter) Miles() Mile

Miles returns the distance in miles.

func (Meter) NauticalMiles added in v1.0.1

func (m Meter) NauticalMiles() NauticalMile

NauticalMiles returns the distance in nautical miles.

func (Meter) Unwrap added in v1.0.1

func (m Meter) Unwrap() float64

type Mile added in v1.0.0

type Mile float64

Mile represents distance in miles.

func (Mile) Km added in v1.0.0

func (mi Mile) Km() Km

Km returns the distance in kilometers.

func (Mile) Meters added in v1.0.1

func (mi Mile) Meters() Meter

Meters returns the distance in meters.

func (Mile) NauticalMiles added in v1.0.0

func (mi Mile) NauticalMiles() NauticalMile

NauticalMiles returns the distance in nautical miles.

func (Mile) Unwrap added in v1.0.0

func (mi Mile) Unwrap() float64

type NauticalMile added in v1.0.0

type NauticalMile float64

NauticalMile represents distance in nautical miles.

func (NauticalMile) Km added in v1.0.0

func (nm NauticalMile) Km() Km

Km returns the distance in kilometers.

func (NauticalMile) Meters added in v1.0.1

func (nm NauticalMile) Meters() Meter

Meters returns the distance in meters.

func (NauticalMile) Miles added in v1.0.0

func (nm NauticalMile) Miles() Mile

Miles returns the distance in miles.

func (NauticalMile) Unwrap added in v1.0.0

func (nm NauticalMile) Unwrap() float64

type PressureInHg

type PressureInHg float64

PressureInHg represents barometric pressure in inches of mercury.

func (PressureInHg) Mb added in v1.0.0

func (p PressureInHg) Mb() PressureMb

Mb converts pressure in inches of mercury to millibars.

func (PressureInHg) Unwrap added in v1.0.0

func (p PressureInHg) Unwrap() float64

type PressureMb

type PressureMb float64

PressureMb represents barometric pressure in millibars.

func (PressureMb) InHg added in v1.0.0

func (p PressureMb) InHg() PressureInHg

InHg converts pressure in millibars to inches of mercury.

func (PressureMb) Unwrap added in v1.0.0

func (p PressureMb) Unwrap() float64

type RelHumidity

type RelHumidity int

RelHumidity represents a relative humidity percentage (0-100, inclusive).

func ClampedRelHumidity added in v1.0.0

func ClampedRelHumidity(rh int) RelHumidity

ClampedRelHumidity returns a RelHumidity from the given integer, guaranteed to be within the valid 0-100 (inclusive) range.

func IndoorHumidityRecommendationC

func IndoorHumidityRecommendationC(outdoorT TempC) RelHumidity

IndoorHumidityRecommendationC returns the maximum recommended indoor relative humidity percentage for the given outdoor temperature (in degrees C).

func IndoorHumidityRecommendationF

func IndoorHumidityRecommendationF(outdoorT TempF) RelHumidity

IndoorHumidityRecommendationF returns the maximum recommended indoor relative humidity percentage for the given outdoor temperature (in degrees F).

func (RelHumidity) Clamped added in v1.0.0

func (rh RelHumidity) Clamped() RelHumidity

Clamped returns a relative humidity guaranteed to be within the valid 0-100 (inclusive) range.

func (RelHumidity) Unwrap added in v1.0.0

func (rh RelHumidity) Unwrap() int

type SpeedKmH added in v1.0.0

type SpeedKmH float64

SpeedKmH represents speed in kilometers per hour.

func (SpeedKmH) Knots added in v1.0.0

func (s SpeedKmH) Knots() SpeedKnots

Knots returns the speed in knots.

func (SpeedKmH) Mph added in v1.0.0

func (s SpeedKmH) Mph() SpeedMph

Mph returns the speed in miles per hour.

func (SpeedKmH) Unwrap added in v1.0.0

func (s SpeedKmH) Unwrap() float64

type SpeedKnots added in v1.0.0

type SpeedKnots float64

SpeedKnots represents speed in knots.

func (SpeedKnots) KmH added in v1.0.0

func (s SpeedKnots) KmH() SpeedKmH

KmH returns the speed in kilometers per hour.

func (SpeedKnots) Mph added in v1.0.0

func (s SpeedKnots) Mph() SpeedMph

Mph returns the speed in miles per hour.

func (SpeedKnots) Unwrap added in v1.0.0

func (s SpeedKnots) Unwrap() float64

type SpeedMph added in v1.0.0

type SpeedMph float64

SpeedMph represents speed (e.g. wind speed) in miles per hour.

func (SpeedMph) KmH added in v1.0.0

func (s SpeedMph) KmH() SpeedKmH

KmH returns the speed in kilometers per hour.

func (SpeedMph) Knots added in v1.0.0

func (s SpeedMph) Knots() SpeedKnots

Knots returns the speed in knots.

func (SpeedMph) Unwrap added in v1.0.0

func (s SpeedMph) Unwrap() float64

type TempC

type TempC float64

TempC represents a temperature in degrees Celsius.

func DewPointC

func DewPointC(t TempC, rh RelHumidity) TempC

DewPointC calculates the dew point given the current temperature (in Celsius) and relative humidity percentage (an integer 0-100, *not* a float 0.0-1.0).

func WindChillC

func WindChillC(temp TempC, windSpeed SpeedMph) TempC

WindChillC calculates the wind chill for the given temperature (in Celsius) and wind speed (in miles/hour). If wind speed is less than 3 mph, or temperature if over 50 degrees, the given temperature is returned - the formula works below 50 degrees and above 3 mph.

func (TempC) F added in v1.0.0

func (t TempC) F() TempF

F converts Celsius temperature to Fahrenheit.

func (TempC) Unwrap added in v1.0.0

func (t TempC) Unwrap() float64

type TempF

type TempF float64

TempF represents a temperature in degrees Fahrenheit.

func DewPointF

func DewPointF(t TempF, rh RelHumidity) TempF

DewPointF calculates the dew point given the current temperature (in Fahrenheit) and relative humidity percentage (an integer 0-100, *not* a float 0.0-1.0).

func WindChillF

func WindChillF(t TempF, windSpeed SpeedMph) TempF

WindChillF calculates the wind chill for the given temperature (in Fahrenheit) and wind speed (in miles/hour). If wind speed is less than 3 mph, or temperature if over 50 degrees, the given temperature is returned - the formula works below 50 degrees and above 3 mph.

func (TempF) C added in v1.0.0

func (t TempF) C() TempC

C converts Fahrenheit temperature to Celsius.

func (TempF) Unwrap added in v1.0.0

func (t TempF) Unwrap() float64

Jump to

Keyboard shortcuts

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