Categorygo.einride.tech/unit
modulepackage
1.12.7
Repository: https://github.com/einride/unit-go.git
Documentation: pkg.go.dev

# README

Unit Go

Go SDK for modeling physical units and conversion between them.

Installation

go get go.einride.tech/unit

Example

angle := 3 * unit.Radian
fmt.Println(angle.Degrees())
// Output: 171.88733853924697

# Functions

FromDegrees returns an Angle from degrees as float64.
FromRadians returns an Angle from radians as float64.
GetFloatingPointCmpOpts compares float unit types with floating point error tolerance.

# Constants

Bar is 100'000 times the SI unit Pascal.
c.
Degree is a measurement of a plane angle in which one full rotation is 360 degrees.
DegreePerSecond is angular speed measured in degrees per second.
Gram is one thousandth of the SI unit for measuring mass, the Kilogram.
Hertz is the SI unit for measuring Frequency.
k.
Kilogram is the SI unit for measuring Mass.
KilometerPerHour is a unit for measuring speed using Kilometer for distance and Hour for time.
KiloPascal is 1000 times the SI unit Pascal.
Meter is the SI unit for measuring Distance.
MeterPerSecond is the SI unit for measuring Speed.
MeterPerSecondCubed is the SI unit for measuring Jerk.
MeterPerSecondSquared is SI unit for measuring Acceleration.
µ.
Mile is a British imperial unit and US customary unit for measuring distance.
m.
n.
Newton is the SI unit for measuring Force.
NewtonMeter is the SI unit for measuring Torque.
Pascal is the SI unit for measuring Pressure.
PerMeter is the SI unit for measuring Curvature.
Radian is the SI unit for measuring an Angle.
RadianPerMeter is the SI unit for measuring Sharpness.
RadianPerSecond is the SI unit for measuring AngularSpeed.
RPM is the number of revolutions in one minute.
Tonne is a thousand of the SI unit for measuring mass, the Kilogram.

# Type aliases

Acceleration is the rate of change of the velocity of an object with respect to time.
Angle is the measure of a plane angle or rotation.
AngularSpeed is a measure of rotation rate.
Curvature is a numerical measurement of inverse physical length.
Distance is a numerical measurement of physical length.
Force is an influence that can change the motion of an object.
Frequency is the number of occurrences of a repeating event per unit of time.
Jerk is the rate at which an object's acceleration changes with respect to time.
Mass is the quantity of matter in a physical body.
Pressure is the force applied perpendicular to the surface of an object per unit area over which that force is distributed.
Sharpness is a numerical measurement of angular change per physical length.
Speed is the rate of change of an object of its position with time.
Torque is the rotational equivalent of linear Force.