units

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: MIT Imports: 0 Imported by: 4

Documentation

Overview

Package units implements simple unit conversion functions.

Index

Constants

View Source
const (
	Inches = 1.0
	Feet   = 0.0833333333
	Meters = 39.37008
)

From units.

View Source
const (
	Centibars = 1.0
)

From units.

View Source
const (
	MPH = 1.0
)

From units.

Variables

This section is empty.

Functions

This section is empty.

Types

type Length

type Length float64

Length is a length stored in Inches.

func (Length) Feet

func (l Length) Feet() float64

Feet returns the length in feet.

func (Length) Inches

func (l Length) Inches() float64

Inches returns the length in inches.

func (Length) Meters

func (l Length) Meters() float64

Meters returns the length in meters.

func (Length) Millimeters

func (l Length) Millimeters() float64

Millimeters returns the length in Millimeters.

type Pressure

type Pressure float64

Pressure is a barometric pressure stored in Inches.

func (Pressure) Hectopascals

func (p Pressure) Hectopascals() float64

Hectopascals returns the pressure in Hectopascals.

func (Pressure) Inches

func (p Pressure) Inches() float64

Inches returns the pressure in Inches.

func (Pressure) Millibars

func (p Pressure) Millibars() float64

Millibars returns the pressure in Millibars.

type SoilMoisture

type SoilMoisture int

SoilMoisture is moisture in centibars of tension.

func (SoilMoisture) Percent

func (m SoilMoisture) Percent(t SoilType) int

Percent returns the soil moisure as an approximated percentage.

type SoilType

type SoilType uint

SoilType is the soil type used for calculating suction.

const (
	Sand SoilType = iota
	SandyLoam
	Loam
	Clay
)

Soil types ranging from sand to clay.

type Speed

type Speed float64

Speed is a speed stored in MPH.

func (Speed) Knots

func (s Speed) Knots() float64

Knots returns the speed in Knots.

func (Speed) MPH

func (s Speed) MPH() float64

MPH returns the speed in Miles per Hour.

func (Speed) MPS

func (s Speed) MPS() float64

MPS returns the speed in Meters per Second.

type Temperature

type Temperature float64

Temperature is a temperature stored in Fahrenheit.

func Celsius

func Celsius(c float64) Temperature

Celsius returns a temperature from a value in Celsius.

func Fahrenheit

func Fahrenheit(f float64) Temperature

Fahrenheit returns a temperature from a value in Fahrenheit.

func (Temperature) Celsius

func (t Temperature) Celsius() float64

Celsius returns the temperature in Celsius.

func (Temperature) Fahrenheit

func (t Temperature) Fahrenheit() float64

Fahrenheit returns the temperature in Fahrenheit.

Jump to

Keyboard shortcuts

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