Documentation
¶
Index ¶
- Constants
- func CurriedFloat64Compare(tolerance float64) func(float64, float64) int
- func CurriedFloat64Equal(tolerance float64) func(float64, float64) bool
- func Float64Compare(a, b, tolerance float64) int
- func Float64Equal(a, b, tolerance float64) bool
- func IntCompare(a, b int) int
- type Km
- type Mile
- type NauticalMile
- type PressureInHg
- type PressureMb
- type RelHumidity
- type SpeedKmH
- type SpeedKnots
- type SpeedMph
- type TempC
- type TempF
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func CurriedFloat64Compare ¶ added in v1.0.0
func CurriedFloat64Equal ¶ added in v1.0.0
func Float64Compare ¶ added in v1.0.0
func Float64Equal ¶ added in v1.0.0
func IntCompare ¶ added in v1.0.0
Types ¶
type Km ¶ added in v1.0.0
type Km float64
Km represents distance in kilometers.
func (Km) NauticalMiles ¶ added in v1.0.0
func (km Km) NauticalMiles() NauticalMile
NauticalMiles returns the distance in nautical miles.
type Mile ¶ added in v1.0.0
type Mile float64
Mile represents distance in miles.
func (Mile) NauticalMiles ¶ added in v1.0.0
func (mi Mile) NauticalMiles() NauticalMile
NauticalMiles returns the distance in nautical miles.
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) 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.
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) Knots ¶ added in v1.0.0
func (s SpeedMph) Knots() SpeedKnots
Knots returns the speed in knots.
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 ¶
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.
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 ¶
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.