unit

package module
Version: v0.0.0-...-19b60e0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 1 Imported by: 49

README

About

Travis-CI codecov.io GoDoc

Conversion of unit library for golang

Installation

go get -u github.com/martinlindhe/unit

General use

Basic usage:

ft := 1 * unit.Foot
fmt.Println(ft.Feet(), "feet is", ft.Meters(), "meters")

To use your own data type, you need to convert to the base unit first (eg Length, Speed etc):

type MyUnit int

n := MyUnit(2)
ft := Length(n) * Foot
fmt.Println(ft.Feet(), "feet is", ft.Meters(), "meters")

Temperature

Cannot be used to scale directly like the other units. Instead, use the From* functions to create a Temperature type:

f := unit.FromFahrenheit(100)

fmt.Println("100 fahrenheit in celsius = ", f.Celsius())

Future work

Please note the resulting precision is limited to the float64 type. Big decimal version is being tracked in https://github.com/martinlindhe/unit/issues/3

License

Under MIT

Documentation

Index

Constants

View Source
const (
	CentimeterPerSecondSquared              = MeterPerSecondSquared * 1e-2     // SI
	MeterPerSecondSquared      Acceleration = 1e0                              // SI
	FootPerSecondSquared                    = MeterPerSecondSquared * 0.304800 // US
	StandardGravity                         = MeterPerSecondSquared * 9.80665  // space
	Gal                                     = CentimeterPerSecondSquared       // alias
)

...

View Source
const (
	Yoctoradian          = Radian * 1e-24
	Zeptoradian          = Radian * 1e-21
	Attoradian           = Radian * 1e-18
	Femtoradian          = Radian * 1e-15
	Picoradian           = Radian * 1e-12
	Nanoradian           = Radian * 1e-9
	Microradian          = Radian * 1e-6
	Milliradian          = Radian * 1e-3
	Centiradian          = Radian * 1e-2
	Deciradian           = Radian * 1e-1
	Radian         Angle = 1e0
	Degree               = Radian * math.Pi / 180
	Arcminute            = Degree / 60
	Arcsecond            = Degree / 3600
	Milliarcsecond       = Arcsecond * 1e-3
	Microarcsecond       = Arcsecond * 1e-6
)

...

View Source
const (
	// SI
	SquareYoctometer      = SquareMeter * 1e-48
	SquareZeptometer      = SquareMeter * 1e-42
	SquareAttometer       = SquareMeter * 1e-36
	SquareFemtometer      = SquareMeter * 1e-30
	SquarePicometer       = SquareMeter * 1e-24
	SquareNanometer       = SquareMeter * 1e-18
	SquareMicrometer      = SquareMeter * 1e-12
	SquareMillimeter      = SquareMeter * 1e-6
	SquareCentimeter      = SquareMeter * 1e-4
	SquareDecimeter       = SquareMeter * 1e-2
	SquareMeter      Area = 1e0
	SquareDecameter       = SquareMeter * 1e2
	SquareHectometer      = SquareMeter * 1e4
	SquareKilometer       = SquareMeter * 1e6
	SquareMegameter       = SquareMeter * 1e12
	SquareGigameter       = SquareMeter * 1e18
	SquareTerameter       = SquareMeter * 1e24
	SquarePetameter       = SquareMeter * 1e30
	SquareExameter        = SquareMeter * 1e36
	SquareZettameter      = SquareMeter * 1e42
	SquareYottameter      = SquareMeter * 1e48

	// US
	SquareInch = SquareMeter * 0.00064516
	SquareFoot = SquareInch * 144
	SquareYard = SquareFoot * 9
	Acre       = SquareYard * 4840
	SquareMile = Acre * 640

	// TW
	//1坪(twPing)= 3.30579 平方公尺
	//1公頃(hectare,twGongQing)= 10000 平方公尺
	//1甲(twJia)= 2934*3.30579 平方公尺
	//1分(twFen)= 293.4*3.30579 平方公尺
	TWGongQing = SquareMeter * 10000
	TWPing     = SquareMeter / 3.30579
	TWFen      = SquareMeter / (293.4 * 3.30579)
	TWJia      = SquareMeter / (2934 * 3.30579)

	// imperial
	SquareRod = SquareFoot * 272.25
	Rood      = SquareYard * 1210

	// aliases
	Centiare    = SquareMeter
	Are         = SquareDecameter
	Hectare     = SquareHectometer
	SquarePerch = SquareRod
)

...

View Source
const (
	// base 10 (SI prefixes)
	BitPerSecond      Datarate = 1e0
	KilobitPerSecond           = BitPerSecond * 1e3
	MegabitPerSecond           = BitPerSecond * 1e6
	GigabitPerSecond           = BitPerSecond * 1e9
	TerabitPerSecond           = BitPerSecond * 1e12
	PetabitPerSecond           = BitPerSecond * 1e15
	ExabitPerSecond            = BitPerSecond * 1e18
	ZettabitPerSecond          = BitPerSecond * 1e21
	YottabitPerSecond          = BitPerSecond * 1e24

	BytePerSecond      = BitPerSecond * 8
	KilobytePerSecond  = BytePerSecond * 1e3
	MegabytePerSecond  = BytePerSecond * 1e6
	GigabytePerSecond  = BytePerSecond * 1e9
	TerabytePerSecond  = BytePerSecond * 1e12
	PetabytePerSecond  = BytePerSecond * 1e15
	ExabytePerSecond   = BytePerSecond * 1e18
	ZettabytePerSecond = BytePerSecond * 1e21
	YottabytePerSecond = BytePerSecond * 1e24

	// base 2 (IEC prefixes)
	KibibitPerSecond = BitPerSecond * 1024
	MebibitPerSecond = KibibitPerSecond * 1024
	GibibitPerSecond = MebibitPerSecond * 1024
	TebibitPerSecond = GibibitPerSecond * 1024
	PebibitPerSecond = TebibitPerSecond * 1024
	ExbibitPerSecond = PebibitPerSecond * 1024
	ZebibitPerSecond = ExbibitPerSecond * 1024
	YobibitPerSecond = ZebibitPerSecond * 1024

	KibibytePerSecond = BytePerSecond * 1024
	MebibytePerSecond = KibibytePerSecond * 1024
	GibibytePerSecond = MebibytePerSecond * 1024
	TebibytePerSecond = GibibytePerSecond * 1024
	PebibytePerSecond = TebibytePerSecond * 1024
	ExbibytePerSecond = PebibytePerSecond * 1024
	ZebibytePerSecond = ExbibytePerSecond * 1024
	YobibytePerSecond = ZebibytePerSecond * 1024
)

...

View Source
const (
	// base 10 (SI prefixes)
	Bit      Datasize = 1e0
	Kilobit           = Bit * 1e3
	Megabit           = Bit * 1e6
	Gigabit           = Bit * 1e9
	Terabit           = Bit * 1e12
	Petabit           = Bit * 1e15
	Exabit            = Bit * 1e18
	Zettabit          = Bit * 1e21
	Yottabit          = Bit * 1e24

	Byte      = Bit * 8
	Kilobyte  = Byte * 1e3
	Megabyte  = Byte * 1e6
	Gigabyte  = Byte * 1e9
	Terabyte  = Byte * 1e12
	Petabyte  = Byte * 1e15
	Exabyte   = Byte * 1e18
	Zettabyte = Byte * 1e21
	Yottabyte = Byte * 1e24

	// base 2 (IEC prefixes)
	Kibibit = Bit * 1024
	Mebibit = Kibibit * 1024
	Gibibit = Mebibit * 1024
	Tebibit = Gibibit * 1024
	Pebibit = Tebibit * 1024
	Exbibit = Pebibit * 1024
	Zebibit = Exbibit * 1024
	Yobibit = Zebibit * 1024

	Kibibyte = Byte * 1024
	Mebibyte = Kibibyte * 1024
	Gibibyte = Mebibyte * 1024
	Tebibyte = Gibibyte * 1024
	Pebibyte = Tebibyte * 1024
	Exbibyte = Pebibyte * 1024
	Zebibyte = Exbibyte * 1024
	Yobibyte = Zebibyte * 1024
)

...

View Source
const (
	// SI
	Yoctosecond          = Second * 1e-24
	Zeptosecond          = Second * 1e-21
	Attosecond           = Second * 1e-18
	Femtosecond          = Second * 1e-15
	Picosecond           = Second * 1e-12
	Nanosecond           = Second * 1e-9
	Microsecond          = Second * 1e-6
	Millisecond          = Second * 1e-3
	Centisecond          = Second * 1e-2
	Decisecond           = Second * 1e-1
	Second      Duration = 1e0
	Decasecond           = Second * 1e1
	Hectosecond          = Second * 1e2
	Kilosecond           = Second * 1e3
	Megasecond           = Second * 1e6
	Gigasecond           = Second * 1e9
	Terasecond           = Second * 1e12
	Petasecond           = Second * 1e15
	Exasecond            = Second * 1e18
	Zettasecond          = Second * 1e21
	Yottasecond          = Second * 1e24

	// non-SI
	Minute         = Second * 60
	Hour           = Minute * 60
	Day            = Hour * 24
	Week           = Day * 7
	ThirtyDayMonth = Day * 30
	JulianYear     = Day * 365.25
)

...

View Source
const (
	// SI
	Yoctoampere                 = Ampere * 1e-24
	Zeptoampere                 = Ampere * 1e-21
	Attoampere                  = Ampere * 1e-18
	Femtoampere                 = Ampere * 1e-15
	Picoampere                  = Ampere * 1e-12
	Nanoampere                  = Ampere * 1e-9
	Microampere                 = Ampere * 1e-6
	Milliampere                 = Ampere * 1e-3
	Deciampere                  = Ampere * 1e-2
	Centiampere                 = Ampere * 1e-1
	Ampere      ElectricCurrent = 1e0
	Decaampere                  = Ampere * 1e1
	Hectoampere                 = Ampere * 1e2
	Kiloampere                  = Ampere * 1e3
	Megaampere                  = Ampere * 1e6
	Gigaampere                  = Ampere * 1e9
	Teraampere                  = Ampere * 1e12
	Petaampere                  = Ampere * 1e15
	Exaampere                   = Ampere * 1e18
	Zettaampere                 = Ampere * 1e21
	Yottaampere                 = Ampere * 1e24
)

...

View Source
const (
	// SI
	Yoctojoule        = Joule * 1e-24
	Zeptojoule        = Joule * 1e-21
	Attojoule         = Joule * 1e-18
	Femtojoule        = Joule * 1e-15
	Picojoule         = Joule * 1e-12
	Nanojoule         = Joule * 1e-9
	Microjoule        = Joule * 1e-6
	Millijoule        = Joule * 1e-3
	Centijoule        = Joule * 1e-2
	Decijoule         = Joule * 1e-1
	Joule      Energy = 1e0
	Decajoule         = Joule * 1e1
	Hectojoule        = Joule * 1e2
	Kilojoule         = Joule * 1e3
	Megajoule         = Joule * 1e6
	Gigajoule         = Joule * 1e9
	Terajoule         = Joule * 1e12
	Petajoule         = Joule * 1e15
	Exajoule          = Joule * 1e18
	Zettajoule        = Joule * 1e21
	Yottajoule        = Joule * 1e24

	// SI-derived
	YoctowattHour = WattHour * 1e-24
	ZeptowattHour = WattHour * 1e-21
	AttowattHour  = WattHour * 1e-18
	FemtowattHour = WattHour * 1e-15
	PicowattHour  = WattHour * 1e-12
	NanowattHour  = WattHour * 1e-9
	MicrowattHour = WattHour * 1e-6
	MilliwattHour = WattHour * 1e-3
	CentiwattHour = WattHour * 1e-2
	DeciwattHour  = WattHour * 1e-1
	WattHour      = Joule * 3600
	DecawattHour  = WattHour * 1e1
	HectowattHour = WattHour * 1e2
	KilowattHour  = WattHour * 1e3
	MegawattHour  = WattHour * 1e6
	GigawattHour  = WattHour * 1e9
	TerawattHour  = WattHour * 1e12
	PetawattHour  = WattHour * 1e15
	ExawattHour   = WattHour * 1e18
	ZettawattHour = WattHour * 1e21
	YottawattHour = WattHour * 1e24

	// constant from https://en.wikipedia.org/wiki/Calorie#Definitions
	Gramcalorie = Joule * 4.184
	Kilocalorie = Gramcalorie * 1e3
	Megacalorie = Gramcalorie * 1e6
)

...

View Source
const (
	// SI
	Newton Force = 1e0

	// non-SI
	Dyne          = Newton * 1e-5
	KilogramForce = Newton * 9.80665
	PoundForce    = Newton * 4.448222
	Poundal       = Newton * 0.138255

	// aliases
	Kilopond = KilogramForce
)

...

View Source
const (
	// SI
	Yoctohertz           = Hertz * 1e-24
	Zeptohertz           = Hertz * 1e-21
	Attohertz            = Hertz * 1e-18
	Femtohertz           = Hertz * 1e-15
	Picohertz            = Hertz * 1e-12
	Nanohertz            = Hertz * 1e-9
	Microhertz           = Hertz * 1e-6
	Millihertz           = Hertz * 1e-3
	Centihertz           = Hertz * 1e-2
	Decihertz            = Hertz * 1e-1
	Hertz      Frequency = 1e0
	Decahertz            = Hertz * 1e1
	Hectohertz           = Hertz * 1e2
	Kilohertz            = Hertz * 1e3
	Megahertz            = Hertz * 1e6
	Gigahertz            = Hertz * 1e9
	Terahertz            = Hertz * 1e12
	Petahertz            = Hertz * 1e15
	Exahertz             = Hertz * 1e18
	Zettahertz           = Hertz * 1e21
	Yottahertz           = Hertz * 1e24
)

...

View Source
const (
	// SI
	Yoctometer              = Meter * 1e-24
	Zeptometer              = Meter * 1e-21
	Attometer               = Meter * 1e-18
	Femtometer              = Meter * 1e-15
	Picometer               = Meter * 1e-12
	Nanometer               = Meter * 1e-9
	Micrometer              = Meter * 1e-6
	Millimeter              = Meter * 1e-3
	Centimeter              = Meter * 1e-2
	Decimeter               = Meter * 1e-1
	Meter            Length = 1e0
	Decameter               = Meter * 1e1
	Hectometer              = Meter * 1e2
	Kilometer               = Meter * 1e3
	ScandinavianMile        = Meter * 1e4
	Megameter               = Meter * 1e6
	Gigameter               = Meter * 1e9
	Terameter               = Meter * 1e12
	Petameter               = Meter * 1e15
	Exameter                = Meter * 1e18
	Zettameter              = Meter * 1e21
	Yottameter              = Meter * 1e24

	// US
	Inch    = Meter * 0.0254
	Hand    = Inch * 4
	Foot    = Inch * 12
	Yard    = Foot * 3
	Link    = Chain / 100
	Rod     = Yard * 5.5
	Chain   = Rod * 4
	Furlong = Chain * 10
	Mile    = Meter * 1609.344

	// US maritime
	Fathom       = Foot * 6
	Cable        = NauticalMile / 10
	NauticalMile = Meter * 1852

	// space
	LunarDistance    = Kilometer * 384400
	AstronomicalUnit = Meter * 149597870700
	LightYear        = Meter * 9460730472580800
)

...

View Source
const (
	// SI
	Yoctogram      = Gram * 1e-24
	Zeptogram      = Gram * 1e-21
	Attogram       = Gram * 1e-18
	Femtogram      = Gram * 1e-15
	Picogram       = Gram * 1e-12
	Nanogram       = Gram * 1e-9
	Microgram      = Gram * 1e-6
	Milligram      = Gram * 1e-3
	Centigram      = Gram * 1e-2
	Decigram       = Gram * 1e-1
	Gram           = Kilogram * 1e-3
	Decagram       = Gram * 1e1
	Hectogram      = Gram * 1e2
	Kilogram  Mass = 1e0
	Megagram       = Gram * 1e6
	Gigagram       = Gram * 1e9
	Teragram       = Gram * 1e12
	Petagram       = Gram * 1e15
	Exagram        = Gram * 1e18
	Zettagram      = Gram * 1e21
	Yottagram      = Gram * 1e24

	// non-SI
	Tonne     = Megagram
	Kilotonne = Gigagram
	Megatonne = Teragram
	Gigatonne = Petagram
	Teratonne = Exagram
	Petatonne = Zettagram
	Exatonne  = Yottagram

	// US, avoirdupois
	TroyGrain          = Milligram * 64.79891
	AvoirdupoisDram    = AvoirdupoisOunce / 16
	AvoirdupoisOunce   = TroyGrain * 437.5
	AvoirdupoisPound   = TroyGrain * 7000
	UsStone            = AvoirdupoisPound * 14
	UsQuarter          = ShortHundredweight / 4
	ShortHundredweight = AvoirdupoisPound * 100

	// UK
	UkStone           = Gram * 6350.29318
	UkQuarter         = LongHundredweight / 4
	LongHundredweight = UkStone * 8
	TroyOunce         = TroyGrain * 480
	TroyPound         = TroyGrain * 5760

	// aliases
	CentalHundredweight   = ShortHundredweight // british
	ImperialHundredweight = LongHundredweight  // british
)

...

View Source
const (
	// SI
	Yoctowatt       = Watt * 1e-24
	Zeptowatt       = Watt * 1e-21
	Attowatt        = Watt * 1e-18
	Femtowatt       = Watt * 1e-15
	Picowatt        = Watt * 1e-12
	Nanowatt        = Watt * 1e-9
	Microwatt       = Watt * 1e-6
	Milliwatt       = Watt * 1e-3
	Centiwatt       = Watt * 1e-2
	Deciwatt        = Watt * 1e-1
	Watt      Power = 1e0
	Decawatt        = Watt * 1e1
	Hectowatt       = Watt * 1e2
	Kilowatt        = Watt * 1e3
	Megawatt        = Watt * 1e6
	Gigawatt        = Watt * 1e9
	Terawatt        = Watt * 1e12
	Petawatt        = Watt * 1e15
	Exawatt         = Watt * 1e18
	Zettawatt       = Watt * 1e21
	Yottawatt       = Watt * 1e24

	// non-SI
	Pferdestarke = Watt * 735.49875
)

...

View Source
const (
	// SI derived
	Yoctopascal          = Pascal * 1e-24
	Zeptopascal          = Pascal * 1e-21
	Attopascal           = Pascal * 1e-18
	Femtopascal          = Pascal * 1e-15
	Picopascal           = Pascal * 1e-12
	Nanopascal           = Pascal * 1e-9
	Micropascal          = Pascal * 1e-6
	Millipascal          = Pascal * 1e-3
	Centipascal          = Pascal * 1e-2
	Decipascal           = Pascal * 1e-1
	Pascal      Pressure = 1e0
	Decapascal           = Pascal * 1e1
	Hectopascal          = Pascal * 1e2
	Kilopascal           = Pascal * 1e3
	Megapascal           = Pascal * 1e6
	Gigapascal           = Pascal * 1e9
	Terapascal           = Pascal * 1e12
	Petapascal           = Pascal * 1e15
	Exapascal            = Pascal * 1e18
	Zettapascal          = Pascal * 1e21
	Yottapascal          = Pascal * 1e24

	// non-SI
	Yoctobar = Bar * 1e-24
	Zeptobar = Bar * 1e-21
	Attobar  = Bar * 1e-18
	Femtobar = Bar * 1e-15
	Picobar  = Bar * 1e-12
	Nanobar  = Bar * 1e-9
	Microbar = Bar * 1e-6
	Millibar = Bar * 1e-3
	Centibar = Bar * 1e-2
	Decibar  = Bar * 1e-1
	Bar      = Pascal * 1e5
	Decabar  = Bar * 1e1
	Hectobar = Bar * 1e2
	Kilobar  = Bar * 1e3
	Megabar  = Bar * 1e6
	Gigabar  = Bar * 1e9
	Terabar  = Bar * 1e12
	Petabar  = Bar * 1e15
	Exabar   = Bar * 1e18
	Zettabar = Bar * 1e21
	Yottabar = Bar * 1e24

	Atmosphere          = Pascal * 1.01325 * 1e5
	TechAtmosphere      = Pascal * 9.80665 * 1e4
	Torr                = Pascal * 133.3224
	PoundsPerSquareInch = Pascal * 6.8948 * 1e3
	InchOfMercury       = Pascal * 3386.389
)

...

View Source
const (
	MetersPerSecond   Speed = 1e0
	KilometersPerHour       = MetersPerSecond * 0.277778
	FeetPerSecond           = MetersPerSecond * 0.3048
	MilesPerHour            = MetersPerSecond * 0.44704
	Knot                    = MetersPerSecond * 0.514444
	SpeedOfLight            = MetersPerSecond * 299792458
)

...

View Source
const (
	// SI
	Yoctovolt         = Volt * 1e-24
	Zeptovolt         = Volt * 1e-21
	Attovolt          = Volt * 1e-18
	Femtovolt         = Volt * 1e-15
	Picovolt          = Volt * 1e-12
	Nanovolt          = Volt * 1e-9
	Microvolt         = Volt * 1e-6
	Millivolt         = Volt * 1e-3
	Centivolt         = Volt * 1e-2
	Decivolt          = Volt * 1e-1
	Volt      Voltage = 1e0
	Decavolt          = Volt * 1e1
	Hectovolt         = Volt * 1e2
	Kilovolt          = Volt * 1e3
	Megavolt          = Volt * 1e6
	Gigavolt          = Volt * 1e9
	Teravolt          = Volt * 1e12
	Petavolt          = Volt * 1e15
	Exavolt           = Volt * 1e18
	Zettavolt         = Volt * 1e21
	Yottavolt         = Volt * 1e24
)

...

View Source
const (
	// SI
	CubicYoctometer        = CubicMeter * 1e-72
	CubicZeptometer        = CubicMeter * 1e-63
	CubicAttometer         = CubicMeter * 1e-54
	CubicFemtometer        = CubicMeter * 1e-45
	CubicPicometer         = CubicMeter * 1e-36
	CubicNanometer         = CubicMeter * 1e-27
	CubicMicrometer        = CubicMeter * 1e-18
	CubicMillimeter        = CubicMeter * 1e-9
	CubicCentimeter        = CubicMeter * 1e-6
	CubicDecimeter         = CubicMeter * 1e-3
	CubicMeter      Volume = 1e0
	CubicDecameter         = CubicMeter * 1e3
	CubicHectometer        = CubicMeter * 1e6
	CubicKilometer         = CubicMeter * 1e9
	CubicMegameter         = CubicMeter * 1e18
	CubicGigameter         = CubicMeter * 1e27
	CubicTerameter         = CubicMeter * 1e36
	CubicPetameter         = CubicMeter * 1e45
	CubicExameter          = CubicMeter * 1e54
	CubicZettameter        = CubicMeter * 1e63
	CubicYottameter        = CubicMeter * 1e72

	// SI derived
	Yoctoliter = Liter * 1e-24
	Zepoliter  = Liter * 1e-21
	Attoliter  = Liter * 1e-18
	Femtoliter = Liter * 1e-15
	Picoliter  = Liter * 1e-12
	Nanoliter  = Liter * 1e-9
	Microliter = Liter * 1e-6
	Milliliter = Liter * 1e-3
	Centiliter = Liter * 1e-2
	Deciliter  = Liter * 1e-1
	Liter      = CubicMeter * 1e-3
	Decaliter  = Liter * 1e1
	Hectoliter = Liter * 1e2
	Kiloliter  = Liter * 1e3
	Megaliter  = Liter * 1e6
	Gigaliter  = Liter * 1e9
	Teraliter  = Liter * 1e12
	Petaliter  = Liter * 1e15
	Exaliter   = Liter * 1e18
	Zettaliter = Liter * 1e21
	Yottaliter = Liter * 1e24

	// US
	CubicInch    = Liter * 0.016387064
	CubicFoot    = CubicInch * 1728
	CubicYard    = CubicFoot * 27
	CubicMile    = CubicYard * 5451776000
	CubicFurlong = CubicMile * 0.00195314

	// imperial liquid
	ImperialGallon     = Liter * 4.54609
	ImperialQuart      = ImperialGallon / 4
	ImperialPint       = ImperialQuart / 2
	ImperialCup        = ImperialPint / 2
	ImperialGill       = ImperialPint / 4
	ImperialFluidOunce = ImperialGill / 5
	ImperialFluidDram  = ImperialFluidOunce / 8
	ImperialPeck       = ImperialGallon * 2
	ImperialBushel     = ImperialPeck * 4

	// metric cooking
	MetricTableSpoon = Milliliter * 15
	MetricTeaSpoon   = Milliliter * 5

	// US liquid
	USLiquidGallon = CubicInch * 231
	USLiquidQuart  = CubicInch * 57.75
	USLiquidPint   = CubicInch * 28.875
	USCup          = USLiquidPint / 2
	USLegalCup     = Milliliter * 240
	USGill         = Milliliter * 118.29411825
	USFluidDram    = USFluidOunce / 8
	USFluidOunce   = USLiquidGallon / 128
	USTableSpoon   = USFluidOunce / 2
	USTeaSpoon     = USTableSpoon / 3

	// US dry
	USDryQuart  = USDryGallon / 4
	USBushel    = USPeck * 4
	USPeck      = USDryGallon * 2
	USDryGallon = CubicInch * 268.8025
	USDryPint   = CubicInch * 33.6003125

	// misc
	AustralianTableSpoon = Milliliter * 20

	// aliases
	ImperialTableSpoon = MetricTableSpoon
	ImperialTeaSpoon   = MetricTeaSpoon
)

...

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceleration

type Acceleration Unit

Acceleration represents a SI unit of acceleration (in meter per second squared, m/s²)

func (Acceleration) CentimetersPerSecondSquared

func (a Acceleration) CentimetersPerSecondSquared() float64

CentimetersPerSecondSquared returns the acceleration in cm/s²

func (Acceleration) FeetPerSecondSquared

func (a Acceleration) FeetPerSecondSquared() float64

FeetPerSecondSquared returns the acceleration in ft/s²

func (Acceleration) Gals

func (a Acceleration) Gals() float64

Gals returns the acceleration in Gal

func (Acceleration) MetersPerSecondSquared

func (a Acceleration) MetersPerSecondSquared() float64

MetersPerSecondSquared returns the acceleration in m/s²

func (Acceleration) StandardGravity

func (a Acceleration) StandardGravity() float64

StandardGravity returns the acceleration in ɡ₀

type AmountOfSubstance

type AmountOfSubstance Unit

AmountOfSubstance represents a SI unit of amount of substance (in mole, mol)

const (
	Mole AmountOfSubstance = 1e0 // SI
)

...

func (AmountOfSubstance) Moles

func (a AmountOfSubstance) Moles() float64

Moles returns the amount of substance in mol

type Angle

type Angle Unit

Angle represents a SI unit of angle (in radians, ㎭)

func (Angle) Arcminutes

func (a Angle) Arcminutes() float64

Arcminutes returns the angle in amin

func (Angle) Arcseconds

func (a Angle) Arcseconds() float64

Arcseconds returns the angle in asec

func (Angle) Attoradians

func (a Angle) Attoradians() float64

Attoradians returns the angle in a㎭

func (Angle) Centiradians

func (a Angle) Centiradians() float64

Centiradians returns the angle in c㎭

func (Angle) Deciradians

func (a Angle) Deciradians() float64

Deciradians returns the angle in d㎭

func (Angle) Degrees

func (a Angle) Degrees() float64

Degrees returns the angle in °

func (Angle) Femtoradians

func (a Angle) Femtoradians() float64

Femtoradians returns the angle in f㎭

func (Angle) Microarcseconds

func (a Angle) Microarcseconds() float64

Microarcseconds returns the angle in µasec

func (Angle) Microradians

func (a Angle) Microradians() float64

Microradians returns the angle in µ㎭

func (Angle) Milliarcseconds

func (a Angle) Milliarcseconds() float64

Milliarcseconds returns the angle in masec

func (Angle) Milliradians

func (a Angle) Milliradians() float64

Milliradians returns the angle in m㎭

func (Angle) Nanoradians

func (a Angle) Nanoradians() float64

Nanoradians returns the angle in n㎭

func (Angle) Picoradians

func (a Angle) Picoradians() float64

Picoradians returns the angle in p㎭

func (Angle) Radians

func (a Angle) Radians() float64

Radians returns the angle in ㎭

func (Angle) Yoctoradians

func (a Angle) Yoctoradians() float64

Yoctoradians returns the angle in y㎭

func (Angle) Zeptoradians

func (a Angle) Zeptoradians() float64

Zeptoradians returns the angle in z㎭

type Area

type Area Unit

Area represents a SI unit of area (in square meters, m²)

func (Area) Acres

func (a Area) Acres() float64

Acres returns the area in ac

func (Area) Ares

func (a Area) Ares() float64

Ares returns the area in a²

func (Area) Centiares

func (a Area) Centiares() float64

Centiares returns the area in ca² (m²)

func (Area) Hectares

func (a Area) Hectares() float64

Hectares returns the area in ha

func (Area) Roods

func (a Area) Roods() float64

Roods returns the area in roods

func (Area) SquareAttometers

func (a Area) SquareAttometers() float64

SquareAttometers returns the area in am²

func (Area) SquareCentimeters

func (a Area) SquareCentimeters() float64

SquareCentimeters returns the area in cm²

func (Area) SquareDecameter

func (a Area) SquareDecameter() float64

SquareDecameter returns the area in dam²

func (Area) SquareDecimeters

func (a Area) SquareDecimeters() float64

SquareDecimeters returns the area in dm²

func (Area) SquareExameters

func (a Area) SquareExameters() float64

SquareExameters returns the area in Em²

func (Area) SquareFeet

func (a Area) SquareFeet() float64

SquareFeet returns the area in ft²

func (Area) SquareFemtometers

func (a Area) SquareFemtometers() float64

SquareFemtometers returns the area in fm²

func (Area) SquareGigameters

func (a Area) SquareGigameters() float64

SquareGigameters returns the area in Gm²

func (Area) SquareHectometer

func (a Area) SquareHectometer() float64

SquareHectometer returns the area in hm² (hectare)

func (Area) SquareInches

func (a Area) SquareInches() float64

SquareInches returns the area in in²

func (Area) SquareKilometers

func (a Area) SquareKilometers() float64

SquareKilometers returns the area in km²

func (Area) SquareMegameters

func (a Area) SquareMegameters() float64

SquareMegameters returns the area in Mm²

func (Area) SquareMeters

func (a Area) SquareMeters() float64

SquareMeters returns the area in m²

func (Area) SquareMicrometers

func (a Area) SquareMicrometers() float64

SquareMicrometers returns the area in µm²

func (Area) SquareMiles

func (a Area) SquareMiles() float64

SquareMiles returns the area in mi²

func (Area) SquareMillimeters

func (a Area) SquareMillimeters() float64

SquareMillimeters returns the area in mm²

func (Area) SquareNanometers

func (a Area) SquareNanometers() float64

SquareNanometers returns the area in nm²

func (Area) SquarePetameters

func (a Area) SquarePetameters() float64

SquarePetameters returns the area in Pm²

func (Area) SquarePicometers

func (a Area) SquarePicometers() float64

SquarePicometers returns the area in pm²

func (Area) SquareRods

func (a Area) SquareRods() float64

SquareRods returns the area in square rods

func (Area) SquareTerameters

func (a Area) SquareTerameters() float64

SquareTerameters returns the area in Tm²

func (Area) SquareYards

func (a Area) SquareYards() float64

SquareYards returns the area in yd

func (Area) SquareYoctometers

func (a Area) SquareYoctometers() float64

SquareYoctometers returns the area in ym²

func (Area) SquareYottameters

func (a Area) SquareYottameters() float64

SquareYottameters returns the area in Ym²

func (Area) SquareZeptometers

func (a Area) SquareZeptometers() float64

SquareZeptometers returns the area in zm²

func (Area) SquareZettameters

func (a Area) SquareZettameters() float64

SquareZettameters returns the area in Zm²

type Datarate

type Datarate Unit

Datarate represents a unit of data rate (in bits per second, bit/s)

func (Datarate) BitsPerSecond

func (b Datarate) BitsPerSecond() float64

BitsPerSecond returns the data rate in bit/s

func (Datarate) BytesPerSecond

func (b Datarate) BytesPerSecond() float64

BytesPerSecond returns the data rate in B/s

func (Datarate) ExabitsPerSecond

func (b Datarate) ExabitsPerSecond() float64

ExabitsPerSecond returns the data rate in Ebit/s

func (Datarate) ExabytesPerSecond

func (b Datarate) ExabytesPerSecond() float64

ExabytesPerSecond returns the data rate in EB/s

func (Datarate) ExbibitsPerSecond

func (b Datarate) ExbibitsPerSecond() float64

ExbibitsPerSecond returns the data rate in Eibit/s

func (Datarate) ExbibytesPerSecond

func (b Datarate) ExbibytesPerSecond() float64

ExbibytesPerSecond returns the data rate in EiB/s

func (Datarate) GibibitsPerSecond

func (b Datarate) GibibitsPerSecond() float64

GibibitsPerSecond returns the data rate in Gibit/s

func (Datarate) GibibytesPerSecond

func (b Datarate) GibibytesPerSecond() float64

GibibytesPerSecond returns the data rate in GiB/s

func (Datarate) GigabitsPerSecond

func (b Datarate) GigabitsPerSecond() float64

GigabitsPerSecond returns the data rate in Gbit/s

func (Datarate) GigabytesPerSecond

func (b Datarate) GigabytesPerSecond() float64

GigabytesPerSecond returns the data rate in GB/s

func (Datarate) KibibitsPerSecond

func (b Datarate) KibibitsPerSecond() float64

KibibitsPerSecond returns the data rate in Kibit/s

func (Datarate) KibibytesPerSecond

func (b Datarate) KibibytesPerSecond() float64

KibibytesPerSecond returns the data rate in KiB/s

func (Datarate) KilobitsPerSecond

func (b Datarate) KilobitsPerSecond() float64

KilobitsPerSecond returns the data rate in kbit/s

func (Datarate) KilobytesPerSecond

func (b Datarate) KilobytesPerSecond() float64

KilobytesPerSecond returns the data rate in kB/s

func (Datarate) MebibitsPerSecond

func (b Datarate) MebibitsPerSecond() float64

MebibitsPerSecond returns the data rate in Mibit/s

func (Datarate) MebibytesPerSecond

func (b Datarate) MebibytesPerSecond() float64

MebibytesPerSecond returns the data rate in MiB/s

func (Datarate) MegabitsPerSecond

func (b Datarate) MegabitsPerSecond() float64

MegabitsPerSecond returns the data rate in Mbit/s

func (Datarate) MegabytesPerSecond

func (b Datarate) MegabytesPerSecond() float64

MegabytesPerSecond returns the data rate in MB/s

func (Datarate) PebibitsPerSecond

func (b Datarate) PebibitsPerSecond() float64

PebibitsPerSecond returns the data rate in Pibit/s

func (Datarate) PebibytesPerSecond

func (b Datarate) PebibytesPerSecond() float64

PebibytesPerSecond returns the data rate in PiB/s

func (Datarate) PetabitsPerSecond

func (b Datarate) PetabitsPerSecond() float64

PetabitsPerSecond returns the data rate in Pbit/s

func (Datarate) PetabytesPerSecond

func (b Datarate) PetabytesPerSecond() float64

PetabytesPerSecond returns the data rate in PB/s

func (Datarate) TebibitsPerSecond

func (b Datarate) TebibitsPerSecond() float64

TebibitsPerSecond returns the data rate in Tibit/s

func (Datarate) TebibytesPerSecond

func (b Datarate) TebibytesPerSecond() float64

TebibytesPerSecond returns the data rate in TiB/s

func (Datarate) TerabitsPerSecond

func (b Datarate) TerabitsPerSecond() float64

TerabitsPerSecond returns the data rate in Tbit/s

func (Datarate) TerabytesPerSecond

func (b Datarate) TerabytesPerSecond() float64

TerabytesPerSecond returns the data rate in TB/s

func (Datarate) YobibitsPerSecond

func (b Datarate) YobibitsPerSecond() float64

YobibitsPerSecond returns the data rate in Yibit/s

func (Datarate) YobibytesPerSecond

func (b Datarate) YobibytesPerSecond() float64

YobibytesPerSecond returns the data rate in YiB/s

func (Datarate) YottabitsPerSecond

func (b Datarate) YottabitsPerSecond() float64

YottabitsPerSecond returns the data rate in Ybit/s

func (Datarate) YottabytesPerSecond

func (b Datarate) YottabytesPerSecond() float64

YottabytesPerSecond returns the data rate in YB/s

func (Datarate) ZebibitsPerSecond

func (b Datarate) ZebibitsPerSecond() float64

ZebibitsPerSecond returns the data rate in Zibit/s

func (Datarate) ZebibytesPerSecond

func (b Datarate) ZebibytesPerSecond() float64

ZebibytesPerSecond returns the data rate in ZiB/s

func (Datarate) ZettabitsPerSecond

func (b Datarate) ZettabitsPerSecond() float64

ZettabitsPerSecond returns the data rate in Zbit/s

func (Datarate) ZettabytesPerSecond

func (b Datarate) ZettabytesPerSecond() float64

ZettabytesPerSecond returns the data rate in ZB/s

type Datasize

type Datasize Unit

Datasize represents a unit of data size (in bits, bit)

func (Datasize) Bits

func (b Datasize) Bits() float64

Bits returns the datasize in bit

func (Datasize) Bytes

func (b Datasize) Bytes() float64

Bytes returns the datasize in B

func (Datasize) Exabits

func (b Datasize) Exabits() float64

Exabits returns the datasize in Ebit

func (Datasize) Exabytes

func (b Datasize) Exabytes() float64

Exabytes returns the datasize in EB

func (Datasize) Exbibits

func (b Datasize) Exbibits() float64

Exbibits returns the datasize in Eibit

func (Datasize) Exbibytes

func (b Datasize) Exbibytes() float64

Exbibytes returns the datasize in EiB

func (Datasize) Gibibits

func (b Datasize) Gibibits() float64

Gibibits returns the datasize in Gibit

func (Datasize) Gibibytes

func (b Datasize) Gibibytes() float64

Gibibytes returns the datasize in GiB

func (Datasize) Gigabits

func (b Datasize) Gigabits() float64

Gigabits returns the datasize in Gbit

func (Datasize) Gigabytes

func (b Datasize) Gigabytes() float64

Gigabytes returns the datasize in GB

func (Datasize) Kibibits

func (b Datasize) Kibibits() float64

Kibibits returns the datasize in Kibit

func (Datasize) Kibibytes

func (b Datasize) Kibibytes() float64

Kibibytes returns the datasize in KiB

func (Datasize) Kilobits

func (b Datasize) Kilobits() float64

Kilobits returns the datasize in kbit

func (Datasize) Kilobytes

func (b Datasize) Kilobytes() float64

Kilobytes returns the datasize in kB

func (Datasize) Mebibits

func (b Datasize) Mebibits() float64

Mebibits returns the datasize in Mibit

func (Datasize) Mebibytes

func (b Datasize) Mebibytes() float64

Mebibytes returns the datasize in MiB

func (Datasize) Megabits

func (b Datasize) Megabits() float64

Megabits returns the datasize in Mbit

func (Datasize) Megabytes

func (b Datasize) Megabytes() float64

Megabytes returns the datasize in MB

func (Datasize) Pebibits

func (b Datasize) Pebibits() float64

Pebibits returns the datasize in Pibit

func (Datasize) Pebibytes

func (b Datasize) Pebibytes() float64

Pebibytes returns the datasize in PiB

func (Datasize) Petabits

func (b Datasize) Petabits() float64

Petabits returns the datasize in Pbit

func (Datasize) Petabytes

func (b Datasize) Petabytes() float64

Petabytes returns the datasize in PB

func (Datasize) Tebibits

func (b Datasize) Tebibits() float64

Tebibits returns the datasize in Tibit

func (Datasize) Tebibytes

func (b Datasize) Tebibytes() float64

Tebibytes returns the datasize in TiB

func (Datasize) Terabits

func (b Datasize) Terabits() float64

Terabits returns the datasize in Tbit

func (Datasize) Terabytes

func (b Datasize) Terabytes() float64

Terabytes returns the datasize in TB

func (Datasize) Yobibits

func (b Datasize) Yobibits() float64

Yobibits returns the datasize in Yibit

func (Datasize) Yobibytes

func (b Datasize) Yobibytes() float64

Yobibytes returns the datasize in YiB

func (Datasize) Yottabits

func (b Datasize) Yottabits() float64

Yottabits returns the datasize in Ybit

func (Datasize) Yottabytes

func (b Datasize) Yottabytes() float64

Yottabytes returns the datasize in YB

func (Datasize) Zebibits

func (b Datasize) Zebibits() float64

Zebibits returns the datasize in Zibit

func (Datasize) Zebibytes

func (b Datasize) Zebibytes() float64

Zebibytes returns the datasize in ZiB

func (Datasize) Zettabits

func (b Datasize) Zettabits() float64

Zettabits returns the datasize in Zbit

func (Datasize) Zettabytes

func (b Datasize) Zettabytes() float64

Zettabytes returns the datasize in ZB

type Duration

type Duration Unit

Duration represents a SI unit of time (in seconds, s)

func (Duration) Attoseconds

func (t Duration) Attoseconds() float64

Attoseconds returns the time in as

func (Duration) Centiseconds

func (t Duration) Centiseconds() float64

Centiseconds returns the time in cs

func (Duration) Days

func (t Duration) Days() float64

Days returns the time in d

func (Duration) Decaseconds

func (t Duration) Decaseconds() float64

Decaseconds returns the time in das

func (Duration) Deciseconds

func (t Duration) Deciseconds() float64

Deciseconds returns the time in ds

func (Duration) Exaseconds

func (t Duration) Exaseconds() float64

Exaseconds returns the time in Es

func (Duration) Femtoseconds

func (t Duration) Femtoseconds() float64

Femtoseconds returns the time in fs

func (Duration) Gigaseconds

func (t Duration) Gigaseconds() float64

Gigaseconds returns the time in Gs

func (Duration) Hectoseconds

func (t Duration) Hectoseconds() float64

Hectoseconds returns the time in hs

func (Duration) Hours

func (t Duration) Hours() float64

Hours returns the time in h

func (Duration) JulianYears

func (t Duration) JulianYears() float64

JulianYears returns the time in Y

func (Duration) Kiloseconds

func (t Duration) Kiloseconds() float64

Kiloseconds returns the time in ks

func (Duration) Megaseconds

func (t Duration) Megaseconds() float64

Megaseconds returns the time in Ms

func (Duration) Microseconds

func (t Duration) Microseconds() float64

Microseconds returns the time in µs

func (Duration) Milliseconds

func (t Duration) Milliseconds() float64

Milliseconds returns the time in ms

func (Duration) Minutes

func (t Duration) Minutes() float64

Minutes returns the time in m

func (Duration) Nanoseconds

func (t Duration) Nanoseconds() float64

Nanoseconds returns the time in ns

func (Duration) Petaseconds

func (t Duration) Petaseconds() float64

Petaseconds returns the time in Ps

func (Duration) Picoseconds

func (t Duration) Picoseconds() float64

Picoseconds returns the time in ps

func (Duration) Seconds

func (t Duration) Seconds() float64

Seconds returns the time in s

func (Duration) Teraseconds

func (t Duration) Teraseconds() float64

Teraseconds returns the time in Ts

func (Duration) ThirtyDayMonths

func (t Duration) ThirtyDayMonths() float64

ThirtyDayMonths returns the time in M

func (Duration) Weeks

func (t Duration) Weeks() float64

Weeks returns the time in w

func (Duration) Yoctoseconds

func (t Duration) Yoctoseconds() float64

Yoctoseconds returns the time in ys

func (Duration) Yottaseconds

func (t Duration) Yottaseconds() float64

Yottaseconds returns the time in Ys

func (Duration) Zeptoseconds

func (t Duration) Zeptoseconds() float64

Zeptoseconds returns the time in zs

func (Duration) Zettaseconds

func (t Duration) Zettaseconds() float64

Zettaseconds returns the time in Zs

type ElectricCurrent

type ElectricCurrent Unit

ElectricCurrent represents a SI unit of electric current (in ampere, A)

func (ElectricCurrent) Amperes

func (c ElectricCurrent) Amperes() float64

Amperes returns the electric current in A

func (ElectricCurrent) Attoamperes

func (c ElectricCurrent) Attoamperes() float64

Attoamperes returns the electric current in aA

func (ElectricCurrent) Centiamperes

func (c ElectricCurrent) Centiamperes() float64

Centiamperes returns the electric current in cA

func (ElectricCurrent) Decaamperes

func (c ElectricCurrent) Decaamperes() float64

Decaamperes returns the electric current in daA

func (ElectricCurrent) Deciamperes

func (c ElectricCurrent) Deciamperes() float64

Deciamperes returns the electric current in dA

func (ElectricCurrent) Exaamperes

func (c ElectricCurrent) Exaamperes() float64

Exaamperes returns the electric current in EA

func (ElectricCurrent) Femtoamperes

func (c ElectricCurrent) Femtoamperes() float64

Femtoamperes returns the electric current in fA

func (ElectricCurrent) Gigaamperes

func (c ElectricCurrent) Gigaamperes() float64

Gigaamperes returns the electric current in GA

func (ElectricCurrent) Hectoamperes

func (c ElectricCurrent) Hectoamperes() float64

Hectoamperes returns the electric current in hA

func (ElectricCurrent) Kiloamperes

func (c ElectricCurrent) Kiloamperes() float64

Kiloamperes returns the electric current in kA

func (ElectricCurrent) Megaamperes

func (c ElectricCurrent) Megaamperes() float64

Megaamperes returns the electric current in MA

func (ElectricCurrent) Microamperes

func (c ElectricCurrent) Microamperes() float64

Microamperes returns the electric current in µA

func (ElectricCurrent) Milliamperes

func (c ElectricCurrent) Milliamperes() float64

Milliamperes returns the electric current in mA

func (ElectricCurrent) Nanoamperes

func (c ElectricCurrent) Nanoamperes() float64

Nanoamperes returns the electric current in nA

func (ElectricCurrent) Petaamperes

func (c ElectricCurrent) Petaamperes() float64

Petaamperes returns the electric current in PA

func (ElectricCurrent) Picoamperes

func (c ElectricCurrent) Picoamperes() float64

Picoamperes returns the electric current in pA

func (ElectricCurrent) Teraamperes

func (c ElectricCurrent) Teraamperes() float64

Teraamperes returns the electric current in TA

func (ElectricCurrent) Yoctoamperes

func (c ElectricCurrent) Yoctoamperes() float64

Yoctoamperes returns the electric current in yA

func (ElectricCurrent) Yottaamperes

func (c ElectricCurrent) Yottaamperes() float64

Yottaamperes returns the electric current in YA

func (ElectricCurrent) Zeptoamperes

func (c ElectricCurrent) Zeptoamperes() float64

Zeptoamperes returns the electric current in zA

func (ElectricCurrent) Zettaamperes

func (c ElectricCurrent) Zettaamperes() float64

Zettaamperes returns the electric current in ZA

type ElectricalConductance

type ElectricalConductance Unit

ElectricalConductance represents a SI unit of electrical conductance (in siemens, S)

const (
	Siemens ElectricalConductance = 1e0 // SI
)

...

func (ElectricalConductance) Siemens

func (e ElectricalConductance) Siemens() float64

Siemens returns the amount of substance in S

type ElectricalResistance

type ElectricalResistance Unit

ElectricalResistance represents a SI derived unit of electrical resistance (in ohm, Ω)

const (
	Ohm ElectricalResistance = 1e0 // SI
)

...

func (ElectricalResistance) Ohms

func (e ElectricalResistance) Ohms() float64

Ohms returns the electrical resistance in Ω

type Energy

type Energy Unit

Energy represents a SI unit of energy (in joules, J)

func (Energy) Attojoules

func (e Energy) Attojoules() float64

Attojoules returns the energy in aJ

func (Energy) AttowattHours

func (e Energy) AttowattHours() float64

AttowattHours returns the energy in aWh

func (Energy) Centijoules

func (e Energy) Centijoules() float64

Centijoules returns the energy in cJ

func (Energy) CentiwattHours

func (e Energy) CentiwattHours() float64

CentiwattHours returns the energy in cWh

func (Energy) Decajoules

func (e Energy) Decajoules() float64

Decajoules returns the energy in dJ

func (Energy) DecawattHours

func (e Energy) DecawattHours() float64

DecawattHours returns the energy in daWh

func (Energy) Decijoules

func (e Energy) Decijoules() float64

Decijoules returns the energy in dJ

func (Energy) DeciwattHours

func (e Energy) DeciwattHours() float64

DeciwattHours returns the energy in dWh

func (Energy) Exajoules

func (e Energy) Exajoules() float64

Exajoules returns the energy in EJ

func (Energy) ExawattHours

func (e Energy) ExawattHours() float64

ExawattHours returns the energy in EWh

func (Energy) Femtojoules

func (e Energy) Femtojoules() float64

Femtojoules returns the energy in fJ

func (Energy) FemtowattHours

func (e Energy) FemtowattHours() float64

FemtowattHours returns the energy in fWh

func (Energy) Gigajoules

func (e Energy) Gigajoules() float64

Gigajoules returns the energy in GJ

func (Energy) GigawattHours

func (e Energy) GigawattHours() float64

GigawattHours returns the energy in GWh

func (Energy) Hectojoules

func (e Energy) Hectojoules() float64

Hectojoules returns the energy in hJ

func (Energy) HectowattHours

func (e Energy) HectowattHours() float64

HectowattHours returns the energy in hWh

func (Energy) Joules

func (e Energy) Joules() float64

Joules returns the energy in J

func (Energy) Kilojoules

func (e Energy) Kilojoules() float64

Kilojoules returns the energy in kJ

func (Energy) KilowattHours

func (e Energy) KilowattHours() float64

KilowattHours returns the energy in kWh

func (Energy) Megajoules

func (e Energy) Megajoules() float64

Megajoules returns the energy in MJ

func (Energy) MegawattHours

func (e Energy) MegawattHours() float64

MegawattHours returns the energy in MWh

func (Energy) Microjoules

func (e Energy) Microjoules() float64

Microjoules returns the energy in µJ

func (Energy) MicrowattHours

func (e Energy) MicrowattHours() float64

MicrowattHours returns the energy in µWh

func (Energy) Millijoules

func (e Energy) Millijoules() float64

Millijoules returns the energy in mJ

func (Energy) MilliwattHours

func (e Energy) MilliwattHours() float64

MilliwattHours returns the energy in mWh

func (Energy) Nanojoules

func (e Energy) Nanojoules() float64

Nanojoules returns the energy in nJ

func (Energy) NanowattHours

func (e Energy) NanowattHours() float64

NanowattHours returns the energy in nWh

func (Energy) Petajoules

func (e Energy) Petajoules() float64

Petajoules returns the energy in PJ

func (Energy) PetawattHours

func (e Energy) PetawattHours() float64

PetawattHours returns the energy in PWh

func (Energy) Picojoules

func (e Energy) Picojoules() float64

Picojoules returns the energy in pJ

func (Energy) PicowattHours

func (e Energy) PicowattHours() float64

PicowattHours returns the energy in pWh

func (Energy) Terajoules

func (e Energy) Terajoules() float64

Terajoules returns the energy in TJ

func (Energy) TerawattHours

func (e Energy) TerawattHours() float64

TerawattHours returns the energy in TWh

func (Energy) WattHours

func (e Energy) WattHours() float64

WattHours returns the energy in Wh

func (Energy) Yoctojoules

func (e Energy) Yoctojoules() float64

Yoctojoules returns the energy in yJ

func (Energy) YoctowattHours

func (e Energy) YoctowattHours() float64

YoctowattHours returns the energy in yWh

func (Energy) Yottajoules

func (e Energy) Yottajoules() float64

Yottajoules returns the energy in YJ

func (Energy) YottawattHours

func (e Energy) YottawattHours() float64

YottawattHours returns the energy in YWh

func (Energy) Zeptojoules

func (e Energy) Zeptojoules() float64

Zeptojoules returns the energy in zJ

func (Energy) ZeptowattHours

func (e Energy) ZeptowattHours() float64

ZeptowattHours returns the energy in zWh

func (Energy) Zettajoules

func (e Energy) Zettajoules() float64

Zettajoules returns the energy in ZJ

func (Energy) ZettawattHours

func (e Energy) ZettawattHours() float64

ZettawattHours returns the energy in ZWh

type Force

type Force Unit

Force represents a SI unit of force (in newtons, N)

func (Force) Dynes

func (f Force) Dynes() float64

Dynes returns the force in dyn

func (Force) KilogramForce

func (f Force) KilogramForce() float64

KilogramForce returns the force in kp

func (Force) Newtons

func (f Force) Newtons() float64

Newtons returns the force in N

func (Force) PoundForce

func (f Force) PoundForce() float64

PoundForce returns the force in lbf

func (Force) Poundals

func (f Force) Poundals() float64

Poundals returns the force in pdl

type Frequency

type Frequency Unit

Frequency represents a SI unit of frequency (in hertz, Hz)

func (Frequency) Attohertz

func (f Frequency) Attohertz() float64

Attohertz returns the frequency in aHz

func (Frequency) Centihertz

func (f Frequency) Centihertz() float64

Centihertz returns the frequency in cHz

func (Frequency) Decahertz

func (f Frequency) Decahertz() float64

Decahertz returns the frequency in daHz

func (Frequency) Decihertz

func (f Frequency) Decihertz() float64

Decihertz returns the frequency in dHz

func (Frequency) Exahertz

func (f Frequency) Exahertz() float64

Exahertz returns the frequency in EHz

func (Frequency) Femtohertz

func (f Frequency) Femtohertz() float64

Femtohertz returns the frequency in fHz

func (Frequency) Gigahertz

func (f Frequency) Gigahertz() float64

Gigahertz returns the frequency in GHz

func (Frequency) Hectohertz

func (f Frequency) Hectohertz() float64

Hectohertz returns the frequency in hHz

func (Frequency) Hertz

func (f Frequency) Hertz() float64

Hertz returns the frequency in Hz

func (Frequency) Kilohertz

func (f Frequency) Kilohertz() float64

Kilohertz returns the frequency in kHz

func (Frequency) Megahertz

func (f Frequency) Megahertz() float64

Megahertz returns the frequency in MHz

func (Frequency) Microhertz

func (f Frequency) Microhertz() float64

Microhertz returns the frequency in µHz

func (Frequency) Millihertz

func (f Frequency) Millihertz() float64

Millihertz returns the frequency in mHz

func (Frequency) Nanohertz

func (f Frequency) Nanohertz() float64

Nanohertz returns the frequency in nHz

func (Frequency) Petahertz

func (f Frequency) Petahertz() float64

Petahertz returns the frequency in PHz

func (Frequency) Picohertz

func (f Frequency) Picohertz() float64

Picohertz returns the frequency in pHz

func (Frequency) Terahertz

func (f Frequency) Terahertz() float64

Terahertz returns the frequency in THz

func (Frequency) Yoctohertz

func (f Frequency) Yoctohertz() float64

Yoctohertz returns the frequency in yHz

func (Frequency) Yottahertz

func (f Frequency) Yottahertz() float64

Yottahertz returns the frequency in YHz

func (Frequency) Zeptohertz

func (f Frequency) Zeptohertz() float64

Zeptohertz returns the frequency in zHz

func (Frequency) Zettahertz

func (f Frequency) Zettahertz() float64

Zettahertz returns the frequency in ZHz

type Illuminance

type Illuminance Unit

Illuminance represents a SI unit for illuminance (in lux, lx)

const (
	Lux Illuminance = 1e0 // SI
)

constants

func (Illuminance) Lux

func (i Illuminance) Lux() float64

Lux returns the illuminance in lx

type Length

type Length Unit

Length represents a SI unit of length (in meters, m)

func (Length) AstronomicalUnits

func (l Length) AstronomicalUnits() float64

AstronomicalUnits returns the length in au

func (Length) Attometers

func (l Length) Attometers() float64

Attometers returns the length in am

func (Length) Cables

func (l Length) Cables() float64

Cables returns the length in cable

func (Length) Centimeters

func (l Length) Centimeters() float64

Centimeters returns the length in cm

func (Length) Chains

func (l Length) Chains() float64

Chains returns the length in ch

func (Length) Decameters

func (l Length) Decameters() float64

Decameters returns the length in dam

func (Length) Decimeters

func (l Length) Decimeters() float64

Decimeters returns the length in dm

func (Length) Exameters

func (l Length) Exameters() float64

Exameters returns the length in in Em

func (Length) Fathoms

func (l Length) Fathoms() float64

Fathoms returns the length in fathom

func (Length) Feet

func (l Length) Feet() float64

Feet returns the length in ft

func (Length) Femtometers

func (l Length) Femtometers() float64

Femtometers returns the length in fm

func (Length) Furlongs

func (l Length) Furlongs() float64

Furlongs returns the length in furlong

func (Length) Gigameters

func (l Length) Gigameters() float64

Gigameters returns the length in in Gm

func (Length) Hands

func (l Length) Hands() float64

Hands returns the length in h

func (Length) Hectometers

func (l Length) Hectometers() float64

Hectometers returns the length in hm

func (Length) Inches

func (l Length) Inches() float64

Inches returns the length in in

func (Length) Kilometers

func (l Length) Kilometers() float64

Kilometers returns the length in km

func (Length) LightYears

func (l Length) LightYears() float64

LightYears returns the length in ly

func (l Length) Links() float64

Links return the length in li

func (Length) LunarDistances

func (l Length) LunarDistances() float64

LunarDistances returns the length in ld

func (Length) Megameters

func (l Length) Megameters() float64

Megameters returns the length in in Mm

func (Length) Meters

func (l Length) Meters() float64

Meters returns the length in m

func (Length) Micrometers

func (l Length) Micrometers() float64

Micrometers returns the length in microms

func (Length) Miles

func (l Length) Miles() float64

Miles returns the length in mi

func (Length) Millimeters

func (l Length) Millimeters() float64

Millimeters returns the length in mm

func (Length) Nanometers

func (l Length) Nanometers() float64

Nanometers returns the length in nm

func (Length) NauticalMiles

func (l Length) NauticalMiles() float64

NauticalMiles returns the length in nm

func (Length) Petameters

func (l Length) Petameters() float64

Petameters returns the length in in Pm

func (Length) Picometers

func (l Length) Picometers() float64

Picometers returns the length in pm

func (Length) Rods

func (l Length) Rods() float64

Rods returns the length in rod

func (Length) ScandinavianMiles

func (l Length) ScandinavianMiles() float64

ScandinavianMiles returns the length in in scandinavian miles (1 scandmile = 10 km)

func (Length) Terameters

func (l Length) Terameters() float64

Terameters returns the length in in Tm

func (Length) Yards

func (l Length) Yards() float64

Yards returns the length in yd

func (Length) Yoctometers

func (l Length) Yoctometers() float64

Yoctometers returns the length in ym

func (Length) Yottameters

func (l Length) Yottameters() float64

Yottameters returns the length in in Ym

func (Length) Zeptometers

func (l Length) Zeptometers() float64

Zeptometers returns the length in zm

func (Length) Zettameters

func (l Length) Zettameters() float64

Zettameters returns the length in in Zm

type LuminousFlux

type LuminousFlux Unit

LuminousFlux represents a SI unit for luminous flux (in lumen, lm)

const (
	Lumen LuminousFlux = 1e0 // SI
)

constants

func (LuminousFlux) Lumen

func (l LuminousFlux) Lumen() float64

Lumen returns the luminous flux in lm

type LuminousIntensity

type LuminousIntensity Unit

LuminousIntensity represents a SI unit for luminous intensity (in candela, cd)

const (
	Candela LuminousIntensity = 1e0
)

constants

func (LuminousIntensity) Candela

func (l LuminousIntensity) Candela() float64

Candela returns the luminous intensity in cd

type Mass

type Mass Unit

Mass represents a SI unit of mass (in grams, G)

func (Mass) Attograms

func (m Mass) Attograms() float64

Attograms returns the mass in ag

func (Mass) AvoirdupoisDrams

func (m Mass) AvoirdupoisDrams() float64

AvoirdupoisDrams returns the mass in XXX

func (Mass) AvoirdupoisOunces

func (m Mass) AvoirdupoisOunces() float64

AvoirdupoisOunces returns the mass in oz

func (Mass) AvoirdupoisPounds

func (m Mass) AvoirdupoisPounds() float64

AvoirdupoisPounds returns the mass in lb

func (Mass) Centigrams

func (m Mass) Centigrams() float64

Centigrams returns the mass in cg

func (Mass) Decagrams

func (m Mass) Decagrams() float64

Decagrams returns the mass in dag

func (Mass) Decigrams

func (m Mass) Decigrams() float64

Decigrams returns the mass in dg

func (Mass) Exagrams

func (m Mass) Exagrams() float64

Exagrams returns the mass in Eg

func (Mass) Exatonnes

func (m Mass) Exatonnes() float64

Exatonnes returns the mass in Et

func (Mass) Femtograms

func (m Mass) Femtograms() float64

Femtograms returns the mass in fg

func (Mass) Gigagrams

func (m Mass) Gigagrams() float64

Gigagrams returns the mass in Gg

func (Mass) Gigatonnes

func (m Mass) Gigatonnes() float64

Gigatonnes returns the mass in Gt

func (Mass) Grams

func (m Mass) Grams() float64

Grams returns the mass in g

func (Mass) Hectograms

func (m Mass) Hectograms() float64

Hectograms returns the mass in hg

func (Mass) Kilograms

func (m Mass) Kilograms() float64

Kilograms returns the mass in kg

func (Mass) Kilotonnes

func (m Mass) Kilotonnes() float64

Kilotonnes returns the mass in ktǂ

func (Mass) LongHundredweights

func (m Mass) LongHundredweights() float64

LongHundredweights returns the mass in cwt

func (Mass) Megagrams

func (m Mass) Megagrams() float64

Megagrams returns the mass in Mg

func (Mass) Megatonnes

func (m Mass) Megatonnes() float64

Megatonnes returns the mass in Mt

func (Mass) Micrograms

func (m Mass) Micrograms() float64

Micrograms returns the mass in µg

func (Mass) Milligrams

func (m Mass) Milligrams() float64

Milligrams returns the mass in mg

func (Mass) Nanograms

func (m Mass) Nanograms() float64

Nanograms returns the mass in ng

func (Mass) Petagrams

func (m Mass) Petagrams() float64

Petagrams returns the mass in Pg

func (Mass) Petatonnes

func (m Mass) Petatonnes() float64

Petatonnes returns the mass in Pt

func (Mass) Picograms

func (m Mass) Picograms() float64

Picograms returns the mass in pg

func (Mass) ShortHundredweights

func (m Mass) ShortHundredweights() float64

ShortHundredweights returns the mass in cwt

func (Mass) Teragrams

func (m Mass) Teragrams() float64

Teragrams returns the mass in Tg

func (Mass) Teratonnes

func (m Mass) Teratonnes() float64

Teratonnes returns the mass in Tt

func (Mass) Tonnes

func (m Mass) Tonnes() float64

Tonnes returns the mass in t

func (Mass) TroyGrains

func (m Mass) TroyGrains() float64

TroyGrains returns the mass in gr

func (Mass) TroyOunces

func (m Mass) TroyOunces() float64

TroyOunces returns the mass in oz

func (Mass) TroyPounds

func (m Mass) TroyPounds() float64

TroyPounds returns the mass in lb

func (Mass) UkQuarters

func (m Mass) UkQuarters() float64

UkQuarters returns the mass in qr av

func (Mass) UkStones

func (m Mass) UkStones() float64

UkStones returns the mass in st

func (Mass) UsQuarters

func (m Mass) UsQuarters() float64

UsQuarters returns the mass in qr av

func (Mass) UsStones

func (m Mass) UsStones() float64

UsStones returns the mass in st

func (Mass) Yoctograms

func (m Mass) Yoctograms() float64

Yoctograms returns the mass in yg

func (Mass) Yottagrams

func (m Mass) Yottagrams() float64

Yottagrams returns the mass in Yg

func (Mass) Zeptograms

func (m Mass) Zeptograms() float64

Zeptograms returns the mass in zg

func (Mass) Zettagrams

func (m Mass) Zettagrams() float64

Zettagrams returns the mass in Zg

type Power

type Power Unit

Power represents a SI unit of power (in watts, W)

func (Power) Attowatts

func (p Power) Attowatts() float64

Attowatts returns the power in aW

func (Power) Centiwatts

func (p Power) Centiwatts() float64

Centiwatts returns the power in cW

func (Power) Decawatts

func (p Power) Decawatts() float64

Decawatts returns the power in daW

func (Power) Deciwatts

func (p Power) Deciwatts() float64

Deciwatts returns the power in dW

func (Power) Exawatts

func (p Power) Exawatts() float64

Exawatts returns the power in EW

func (Power) Femtowatts

func (p Power) Femtowatts() float64

Femtowatts returns the power in fW

func (Power) Gigawatts

func (p Power) Gigawatts() float64

Gigawatts returns the power in GW

func (Power) Hectowatts

func (p Power) Hectowatts() float64

Hectowatts returns the power in hW

func (Power) Kilowatts

func (p Power) Kilowatts() float64

Kilowatts returns the power in kW

func (Power) Megawatts

func (p Power) Megawatts() float64

Megawatts returns the power in MW

func (Power) Microwatts

func (p Power) Microwatts() float64

Microwatts returns the power in µW

func (Power) Milliwatts

func (p Power) Milliwatts() float64

Milliwatts returns the power in mW

func (Power) Nanowatts

func (p Power) Nanowatts() float64

Nanowatts returns the power in nW

func (Power) Petawatts

func (p Power) Petawatts() float64

Petawatts returns the power in PW

func (Power) Pferdestarke

func (p Power) Pferdestarke() float64

Pferdestarke returns the power in PS

func (Power) Picowatts

func (p Power) Picowatts() float64

Picowatts returns the power in pW

func (Power) Terawatts

func (p Power) Terawatts() float64

Terawatts returns the power in tW

func (Power) Watts

func (p Power) Watts() float64

Watts returns the power in W

func (Power) Yoctowatts

func (p Power) Yoctowatts() float64

Yoctowatts returns the power in yW

func (Power) Yottawatts

func (p Power) Yottawatts() float64

Yottawatts returns the power in YW

func (Power) Zeptowatts

func (p Power) Zeptowatts() float64

Zeptowatts returns the power in zW

func (Power) Zettawatts

func (p Power) Zettawatts() float64

Zettawatts returns the power in ZW

type Pressure

type Pressure Unit

Pressure represents a SI derived unit of pressure (in pascal, Pa)

func (Pressure) Atmospheres

func (p Pressure) Atmospheres() float64

Atmospheres returns the pressure in atm

func (Pressure) Attobars

func (p Pressure) Attobars() float64

Attobars returns the pressure in abar

func (Pressure) Attopascals

func (p Pressure) Attopascals() float64

Attopascals returns the pressure in aPa

func (Pressure) Bars

func (p Pressure) Bars() float64

Bars returns the pressure in bar

func (Pressure) Centibars

func (p Pressure) Centibars() float64

Centibars returns the pressure in cbar

func (Pressure) Centipascals

func (p Pressure) Centipascals() float64

Centipascals returns the pressure in cPa

func (Pressure) Decabars

func (p Pressure) Decabars() float64

Decabars returns the pressure in dabar

func (Pressure) Decapascals

func (p Pressure) Decapascals() float64

Decapascals returns the pressure in daPa

func (Pressure) Decibars

func (p Pressure) Decibars() float64

Decibars returns the pressure in dbar

func (Pressure) Decipascals

func (p Pressure) Decipascals() float64

Decipascals returns the pressure in dPa

func (Pressure) Exabars

func (p Pressure) Exabars() float64

Exabars returns the pressure in Ebar

func (Pressure) Exapascals

func (p Pressure) Exapascals() float64

Exapascals returns the pressure in EPa

func (Pressure) Femtobars

func (p Pressure) Femtobars() float64

Femtobars returns the pressure in fbar

func (Pressure) Femtopascals

func (p Pressure) Femtopascals() float64

Femtopascals returns the pressure in fPa

func (Pressure) Gigabars

func (p Pressure) Gigabars() float64

Gigabars returns the pressure in Gbar

func (Pressure) Gigapascals

func (p Pressure) Gigapascals() float64

Gigapascals returns the pressure in GPa

func (Pressure) Hectobars

func (p Pressure) Hectobars() float64

Hectobars returns the pressure in hbar

func (Pressure) Hectopascals

func (p Pressure) Hectopascals() float64

Hectopascals returns the pressure in hPa

func (Pressure) InchOfMercury

func (p Pressure) InchOfMercury() float64

InchOfMercury returns the pressure in inch of mercury

func (Pressure) Kilobars

func (p Pressure) Kilobars() float64

Kilobars returns the pressure in kbar

func (Pressure) Kilopascals

func (p Pressure) Kilopascals() float64

Kilopascals returns the pressure in kPa

func (Pressure) Megabars

func (p Pressure) Megabars() float64

Megabars returns the pressure in Mbar

func (Pressure) Megapascals

func (p Pressure) Megapascals() float64

Megapascals returns the pressure in MPa

func (Pressure) Microbars

func (p Pressure) Microbars() float64

Microbars returns the pressure in µbar

func (Pressure) Micropascals

func (p Pressure) Micropascals() float64

Micropascals returns the pressure in µPa

func (Pressure) Millibars

func (p Pressure) Millibars() float64

Millibars returns the pressure in mbar

func (Pressure) Millipascals

func (p Pressure) Millipascals() float64

Millipascals returns the pressure in mPa

func (Pressure) Nanobars

func (p Pressure) Nanobars() float64

Nanobars returns the pressure in nbar

func (Pressure) Nanopascals

func (p Pressure) Nanopascals() float64

Nanopascals returns the pressure in nPa

func (Pressure) Pascals

func (p Pressure) Pascals() float64

Pascals returns the pressure in Pa

func (Pressure) Petabars

func (p Pressure) Petabars() float64

Petabars returns the pressure in Pbar

func (Pressure) Petapascals

func (p Pressure) Petapascals() float64

Petapascals returns the pressure in PPa

func (Pressure) Picobars

func (p Pressure) Picobars() float64

Picobars returns the pressure in pbar

func (Pressure) Picopascals

func (p Pressure) Picopascals() float64

Picopascals returns the pressure in pPa

func (Pressure) PoundsPerSquareInch

func (p Pressure) PoundsPerSquareInch() float64

PoundsPerSquareInch returns the pressure in psi

func (Pressure) TechAtmospheres

func (p Pressure) TechAtmospheres() float64

TechAtmospheres returns the pressure in at

func (Pressure) Terabars

func (p Pressure) Terabars() float64

Terabars returns the pressure in Tbar

func (Pressure) Terapascals

func (p Pressure) Terapascals() float64

Terapascals returns the pressure in TPa

func (Pressure) Torrs

func (p Pressure) Torrs() float64

Torrs returns the pressure in Torr

func (Pressure) Yoctobars

func (p Pressure) Yoctobars() float64

Yoctobars returns the pressure in ybar

func (Pressure) Yoctopascals

func (p Pressure) Yoctopascals() float64

Yoctopascals returns the pressure in yPa

func (Pressure) Yottabars

func (p Pressure) Yottabars() float64

Yottabars returns the pressure in Ybar

func (Pressure) Yottapascals

func (p Pressure) Yottapascals() float64

Yottapascals returns the pressure in YPa

func (Pressure) Zeptobars

func (p Pressure) Zeptobars() float64

Zeptobars returns the pressure in zbar

func (Pressure) Zeptopascals

func (p Pressure) Zeptopascals() float64

Zeptopascals returns the pressure in zPa

func (Pressure) Zettabars

func (p Pressure) Zettabars() float64

Zettabars returns the pressure in Zbar

func (Pressure) Zettapascals

func (p Pressure) Zettapascals() float64

Zettapascals returns the pressure in ZPa

type Speed

type Speed Unit

Speed represents a unit of speed (in meters per second, m/s)

func (Speed) FeetPerSecond

func (s Speed) FeetPerSecond() float64

FeetPerSecond returns the speed in ft/s

func (Speed) KilometersPerHour

func (s Speed) KilometersPerHour() float64

KilometersPerHour returns the speed in km/h

func (Speed) Knots

func (s Speed) Knots() float64

Knots returns the speed in knots

func (Speed) MetersPerSecond

func (s Speed) MetersPerSecond() float64

MetersPerSecond returns the speed in m/s

func (Speed) MilesPerHour

func (s Speed) MilesPerHour() float64

MilesPerHour returns the speed in mph

func (Speed) SpeedOfLight

func (s Speed) SpeedOfLight() float64

SpeedOfLight returns the speed in c

type Temperature

type Temperature Unit

Temperature represents a SI unit of temperature (in kelvin, K)

const (
	Kelvin Temperature = 1e0
)

...

func FromCelsius

func FromCelsius(t float64) Temperature

FromCelsius converts temperature from °C to °K

func FromDelisle

func FromDelisle(t float64) Temperature

FromDelisle converts temperature from °De to °K

func FromFahrenheit

func FromFahrenheit(t float64) Temperature

FromFahrenheit converts temperature from °F to °K

func FromKelvin

func FromKelvin(t float64) Temperature

FromKelvin converts temperature from °K to °K

func FromNewton

func FromNewton(t float64) Temperature

FromNewton converts temperature from °N to °K

func FromRankine

func FromRankine(t float64) Temperature

FromRankine converts temperature from °Ra to °K

func FromReaumur

func FromReaumur(t float64) Temperature

FromReaumur converts temperature from °Re to °K

func FromRomer

func FromRomer(t float64) Temperature

FromRomer converts temperature from °Ro to °K

func (Temperature) Celsius

func (t Temperature) Celsius() float64

Celsius returns the temperature in °C

func (Temperature) Delisle

func (t Temperature) Delisle() float64

Delisle returns the temperature in °De

func (Temperature) Fahrenheit

func (t Temperature) Fahrenheit() float64

Fahrenheit returns the temperature in °F

func (Temperature) Kelvin

func (t Temperature) Kelvin() float64

Kelvin returns the temperature in °K

func (Temperature) Newton

func (t Temperature) Newton() float64

Newton returns the temperature in °N

func (Temperature) Rankine

func (t Temperature) Rankine() float64

Rankine returns the temperature in °R

func (Temperature) Reaumur

func (t Temperature) Reaumur() float64

Reaumur returns the temperature in °Ré

func (Temperature) Romer

func (t Temperature) Romer() float64

Romer returns the temperature in °Rø

type Unit

type Unit float64

Unit represents a unit

type Voltage

type Voltage Unit

Voltage represents a unit of voltage (in volt, V)

func (Voltage) Attovolts

func (v Voltage) Attovolts() float64

Attovolts returns the voltage in aV

func (Voltage) Centivolts

func (v Voltage) Centivolts() float64

Centivolts returns the voltage in cV

func (Voltage) Decavolts

func (v Voltage) Decavolts() float64

Decavolts returns the voltage in daV

func (Voltage) Decivolts

func (v Voltage) Decivolts() float64

Decivolts returns the voltage in dV

func (Voltage) Exavolts

func (v Voltage) Exavolts() float64

Exavolts returns the voltage in EV

func (Voltage) Femtovolts

func (v Voltage) Femtovolts() float64

Femtovolts returns the voltage in fV

func (Voltage) Gigavolts

func (v Voltage) Gigavolts() float64

Gigavolts returns the voltage in GV

func (Voltage) Hectovolts

func (v Voltage) Hectovolts() float64

Hectovolts returns the voltage in hV

func (Voltage) Kilovolts

func (v Voltage) Kilovolts() float64

Kilovolts returns the voltage in kV

func (Voltage) Megavolts

func (v Voltage) Megavolts() float64

Megavolts returns the voltage in MV

func (Voltage) Microvolts

func (v Voltage) Microvolts() float64

Microvolts returns the voltage in µV

func (Voltage) Millivolts

func (v Voltage) Millivolts() float64

Millivolts returns the voltage in mV

func (Voltage) Nanovolts

func (v Voltage) Nanovolts() float64

Nanovolts returns the voltage in nV

func (Voltage) Petavolts

func (v Voltage) Petavolts() float64

Petavolts returns the voltage in PV

func (Voltage) Picovolts

func (v Voltage) Picovolts() float64

Picovolts returns the voltage in pV

func (Voltage) Teravolts

func (v Voltage) Teravolts() float64

Teravolts returns the voltage in TV

func (Voltage) Volts

func (v Voltage) Volts() float64

Volts returns the voltage in V

func (Voltage) Yoctovolts

func (v Voltage) Yoctovolts() float64

Yoctovolts returns the voltage in yV

func (Voltage) Yottavolts

func (v Voltage) Yottavolts() float64

Yottavolts returns the voltage in YV

func (Voltage) Zeptovolts

func (v Voltage) Zeptovolts() float64

Zeptovolts returns the voltage in zV

func (Voltage) Zettavolts

func (v Voltage) Zettavolts() float64

Zettavolts returns the voltage in ZV

type Volume

type Volume Unit

Volume represents a volume in cubic meters

func (Volume) Attoliters

func (v Volume) Attoliters() float64

Attoliters returns the volume in al

func (Volume) AustralianTableSpoons

func (v Volume) AustralianTableSpoons() float64

AustralianTableSpoons returns the volume in Australian tablespoons

func (Volume) Centiliters

func (v Volume) Centiliters() float64

Centiliters returns the volume in cl

func (Volume) CubicAttometers

func (v Volume) CubicAttometers() float64

CubicAttometers returns the volume in am³

func (Volume) CubicCentimeters

func (v Volume) CubicCentimeters() float64

CubicCentimeters returns the volume in cm³

func (Volume) CubicDecameters

func (v Volume) CubicDecameters() float64

CubicDecameters returns the volume in dam³

func (Volume) CubicDecimeters

func (v Volume) CubicDecimeters() float64

CubicDecimeters returns the volume in dm³

func (Volume) CubicExameters

func (v Volume) CubicExameters() float64

CubicExameters returns the volume in Em³

func (Volume) CubicFeet

func (v Volume) CubicFeet() float64

CubicFeet returns the volume in ft³

func (Volume) CubicFemtometers

func (v Volume) CubicFemtometers() float64

CubicFemtometers returns the volume in fm³

func (Volume) CubicFurlongs

func (v Volume) CubicFurlongs() float64

CubicFurlongs returns the volume in furlong³

func (Volume) CubicGigameters

func (v Volume) CubicGigameters() float64

CubicGigameters returns the volume in Gm³

func (Volume) CubicHectometers

func (v Volume) CubicHectometers() float64

CubicHectometers returns the volume in hm³

func (Volume) CubicInches

func (v Volume) CubicInches() float64

CubicInches returns the volume in in³

func (Volume) CubicKilometers

func (v Volume) CubicKilometers() float64

CubicKilometers returns the volume in km³

func (Volume) CubicMegameters

func (v Volume) CubicMegameters() float64

CubicMegameters returns the volume in Mm³

func (Volume) CubicMeters

func (v Volume) CubicMeters() float64

CubicMeters returns the volume in m³

func (Volume) CubicMicrometers

func (v Volume) CubicMicrometers() float64

CubicMicrometers returns the volume in µm³

func (Volume) CubicMiles

func (v Volume) CubicMiles() float64

CubicMiles returns the volume in mi³

func (Volume) CubicMillimeters

func (v Volume) CubicMillimeters() float64

CubicMillimeters returns the volume in mm³

func (Volume) CubicNanometers

func (v Volume) CubicNanometers() float64

CubicNanometers returns the volume in nm³

func (Volume) CubicPetameters

func (v Volume) CubicPetameters() float64

CubicPetameters returns the volume in Pm³

func (Volume) CubicPicometers

func (v Volume) CubicPicometers() float64

CubicPicometers returns the volume in pm³

func (Volume) CubicTerameters

func (v Volume) CubicTerameters() float64

CubicTerameters returns the volume in Tm³

func (Volume) CubicYards

func (v Volume) CubicYards() float64

CubicYards returns the volume in yd³

func (Volume) CubicYoctometers

func (v Volume) CubicYoctometers() float64

CubicYoctometers returns the volume in ym³

func (Volume) CubicYottameters

func (v Volume) CubicYottameters() float64

CubicYottameters returns the volume in Ym³

func (Volume) CubicZeptometers

func (v Volume) CubicZeptometers() float64

CubicZeptometers returns the volume in zm³

func (Volume) CubicZettameters

func (v Volume) CubicZettameters() float64

CubicZettameters returns the volume in Zm³

func (Volume) Decaliters

func (v Volume) Decaliters() float64

Decaliters returns the volume in Dl

func (Volume) Deciliters

func (v Volume) Deciliters() float64

Deciliters returns the volume in dl

func (Volume) Exaliters

func (v Volume) Exaliters() float64

Exaliters returns the volume in El

func (Volume) Femtoliters

func (v Volume) Femtoliters() float64

Femtoliters returns the volume in fl

func (Volume) Gigaliters

func (v Volume) Gigaliters() float64

Gigaliters returns the volume in Gl

func (Volume) Hectoliters

func (v Volume) Hectoliters() float64

Hectoliters returns the volume in Hl

func (Volume) ImperialBushels

func (v Volume) ImperialBushels() float64

ImperialBushels returns the volume in imperial bushels

func (Volume) ImperialCups

func (v Volume) ImperialCups() float64

ImperialCups returns the volume in imperial cups

func (Volume) ImperialFluidDrams

func (v Volume) ImperialFluidDrams() float64

ImperialFluidDrams returns the volume in imperial fluid drams

func (Volume) ImperialFluidOunces

func (v Volume) ImperialFluidOunces() float64

ImperialFluidOunces returns the volume in imperial fluid ounces

func (Volume) ImperialGallons

func (v Volume) ImperialGallons() float64

ImperialGallons returns the volume in imperial gallons

func (Volume) ImperialGills

func (v Volume) ImperialGills() float64

ImperialGills returns the volume in imperial gills

func (Volume) ImperialPecks

func (v Volume) ImperialPecks() float64

ImperialPecks returns the volume in imperial pecks

func (Volume) ImperialPints

func (v Volume) ImperialPints() float64

ImperialPints returns the volume in imperial pints

func (Volume) ImperialQuarts

func (v Volume) ImperialQuarts() float64

ImperialQuarts returns the volume in imperial quarts

func (Volume) ImperialTableSpoons

func (v Volume) ImperialTableSpoons() float64

ImperialTableSpoons returns the volume in metric/imperial tablespoons

func (Volume) ImperialTeaSpoons

func (v Volume) ImperialTeaSpoons() float64

ImperialTeaSpoons returns the volume in metric/imperial teaspoons

func (Volume) Kiloliters

func (v Volume) Kiloliters() float64

Kiloliters returns the volume in Kl

func (Volume) Liters

func (v Volume) Liters() float64

Liters returns the volume in l

func (Volume) Megaliters

func (v Volume) Megaliters() float64

Megaliters returns the volume in Ml

func (Volume) MetricTableSpoons

func (v Volume) MetricTableSpoons() float64

MetricTableSpoons returns the volume in metric/imperial tablespoons

func (Volume) MetricTeaSpoons

func (v Volume) MetricTeaSpoons() float64

MetricTeaSpoons returns the volume in metric/imperial teaspoons

func (Volume) Microliters

func (v Volume) Microliters() float64

Microliters returns the volume in µl

func (Volume) Milliliters

func (v Volume) Milliliters() float64

Milliliters returns the volume in ml

func (Volume) Nanoliters

func (v Volume) Nanoliters() float64

Nanoliters returns the volume in nl

func (Volume) Petaliters

func (v Volume) Petaliters() float64

Petaliters returns the volume in Pl

func (Volume) Picoliters

func (v Volume) Picoliters() float64

Picoliters returns the volume in pl

func (Volume) Teraliters

func (v Volume) Teraliters() float64

Teraliters returns the volume in Tl

func (Volume) USBushels

func (v Volume) USBushels() float64

USBushels returns the volume in US bushels

func (Volume) USCups

func (v Volume) USCups() float64

USCups returns the volume in US cups

func (Volume) USDryGallons

func (v Volume) USDryGallons() float64

USDryGallons returns the volume in US dry gallons

func (Volume) USDryPints

func (v Volume) USDryPints() float64

USDryPints returns the volume in US dry pints

func (Volume) USDryQuarts

func (v Volume) USDryQuarts() float64

USDryQuarts returns the volume in US dry quarts

func (Volume) USFluidDrams

func (v Volume) USFluidDrams() float64

USFluidDrams returns the volume in US fluid drams

func (Volume) USFluidOunces

func (v Volume) USFluidOunces() float64

USFluidOunces returns the volume in US fluid ounces

func (Volume) USGills

func (v Volume) USGills() float64

USGills returns the volume in US gills

func (Volume) USLegalCups

func (v Volume) USLegalCups() float64

USLegalCups returns the volume in US legal cups

func (Volume) USLiquidGallons

func (v Volume) USLiquidGallons() float64

USLiquidGallons returns the volume in US liquid gallons

func (Volume) USLiquidPints

func (v Volume) USLiquidPints() float64

USLiquidPints returns the volume in US liquid pints

func (Volume) USLiquidQuarts

func (v Volume) USLiquidQuarts() float64

USLiquidQuarts returns the volume in US liquid quarts

func (Volume) USPecks

func (v Volume) USPecks() float64

USPecks returns the volume in US pecks

func (Volume) USTableSpoons

func (v Volume) USTableSpoons() float64

USTableSpoons returns the volume in US table spoons

func (Volume) USTeaSpoons

func (v Volume) USTeaSpoons() float64

USTeaSpoons returns the volume in US tea spoons

func (Volume) Yoctoliters

func (v Volume) Yoctoliters() float64

Yoctoliters returns the volume in yl

func (Volume) Zepoliters

func (v Volume) Zepoliters() float64

Zepoliters returns the volume in zl

func (Volume) Zettaliters

func (v Volume) Zettaliters() float64

Zettaliters returns the volume in Zl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL