Documentation
¶
Overview ¶
Package measure is typed quantities in natural units: the speed of light, the reduced planck constant and boltzmann's constant are all one, so mass, temperature and energy are one kind of thing, counted in MeV, and length and time are its inverse.
Every quantity is a type, made from the unit it comes in and read back out in the unit it goes out in. A caller hands in si units and reads si units back; the natural units are held inside. A bare number never crosses a package line, so a mass can't be handed in where an age goes.
exact.go turns the si's units into natural units through the si's own defining constants, which are exact. measured.go reads what is measured from celestial's research data. laws.go is what follows.
Index ¶
- type Angle
- type Area
- type Coord
- type Direction
- type Displacement
- func (by Displacement) AlongX() Length
- func (by Displacement) AlongY() Length
- func (by Displacement) AlongZ() Length
- func (by Displacement) Cross(moving Velocity) Sweep
- func (by Displacement) Direction() (*Direction, error)
- func (by Displacement) Dot(other Displacement) Area
- func (by Displacement) Length() Length
- func (by Displacement) Minus(other Displacement) Displacement
- func (by Displacement) Plus(other Displacement) Displacement
- func (by Displacement) Times(share float64) Displacement
- type Duration
- type Energy
- type Length
- type LightFraction
- type Mass
- func (mass Mass) Energy() Energy
- func (mass Mass) InKilograms() float64
- func (mass Mass) InMeV() float64
- func (mass Mass) InSolarMasses() float64
- func (mass Mass) Minus(less Mass) Mass
- func (mass Mass) Over(other Mass) float64
- func (mass Mass) Positive() bool
- func (mass Mass) Times(share float64) Mass
- type Nominal
- type Power
- type Sweep
- type Temperature
- type Velocity
- func (moving Velocity) AlongX() LightFraction
- func (moving Velocity) AlongY() LightFraction
- func (moving Velocity) AlongZ() LightFraction
- func (moving Velocity) Dot(other Velocity) float64
- func (moving Velocity) Minus(other Velocity) Velocity
- func (moving Velocity) Plus(other Velocity) Velocity
- func (moving Velocity) Speed() LightFraction
- func (moving Velocity) Times(share float64) Velocity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Angle ¶
type Angle struct {
// contains filtered or unexported fields
}
Angle is an angle, held in radians, which have no unit.
func Arcseconds ¶
Arcseconds is an angle in arcseconds, the unit positions and their errors on the sky are given in.
func (Angle) InArcseconds ¶
InArcseconds is the angle in arcseconds.
type Area ¶
type Area struct {
// contains filtered or unexported fields
}
Area is an area, held in one over MeV squared
func Thomson ¶
func Thomson() Area
Thomson is how much of a beam one free electron turns aside: from how strongly light and charge couple, and the electron's mass.
func (Area) InSquareMetres ¶
InSquareMetres is the area in m2
type Coord ¶
type Coord struct {
// contains filtered or unexported fields
}
Coord is a place: x, y and z, each a position in natural units.
func (Coord) Minus ¶
func (place Coord) Minus(from Coord) Displacement
Minus is how far this place is from another.
func (Coord) Plus ¶
func (place Coord) Plus(by Displacement) Coord
Plus is the place a displacement from this one.
type Direction ¶
type Direction struct {
// contains filtered or unexported fields
}
Direction is a way to point: three parts with no unit, a length of one, so it says only which way.
func NewDirection ¶
NewDirection is the way three numbers point. It refuses no way at all, and any part that is not a number or is endless, and then gives no direction.
func (Direction) Dot ¶
Dot is how far this way goes along another: one for the same way, nought for square to it, minus one for opposite.
func (Direction) Times ¶
func (way Direction) Times(length Length) Displacement
Times is a displacement of a length this way.
type Displacement ¶
type Displacement struct {
// contains filtered or unexported fields
}
Displacement is how far, and which way, one place is from another.
func (Displacement) AlongX ¶
func (by Displacement) AlongX() Length
AlongX is the displacement's part along x.
func (Displacement) AlongY ¶
func (by Displacement) AlongY() Length
AlongY is the displacement's part along y, the kit's up.
func (Displacement) AlongZ ¶
func (by Displacement) AlongZ() Length
AlongZ is the displacement's part along z.
func (Displacement) Cross ¶
func (by Displacement) Cross(moving Velocity) Sweep
Cross is the sweep of something this far out moving at a velocity: the plane of its motion, and twice the area it sweeps each moment.
func (Displacement) Direction ¶
func (by Displacement) Direction() (*Direction, error)
Direction is which way the displacement goes; it refuses one that goes nowhere, and then gives no direction.
func (Displacement) Dot ¶
func (by Displacement) Dot(other Displacement) Area
Dot is the displacement against another: their lengths times how far one goes along the other, an area.
func (Displacement) Length ¶
func (by Displacement) Length() Length
Length is how far the displacement goes.
func (Displacement) Minus ¶
func (by Displacement) Minus(other Displacement) Displacement
Minus is this displacement less another.
func (Displacement) Plus ¶
func (by Displacement) Plus(other Displacement) Displacement
Plus is this displacement and another, one after the other.
func (Displacement) Times ¶
func (by Displacement) Times(share float64) Displacement
Times is the displacement scaled by a share.
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
Duration is a time, held in one over MeV
type Energy ¶
type Energy struct {
// contains filtered or unexported fields
}
Energy is an energy, in MeV
func (Energy) InElectronvolts ¶
InElectronvolts is the energy in eV
type Length ¶
type Length struct {
// contains filtered or unexported fields
}
Length is a length, held in one over MeV
func GM ¶
GM is a mass times newton's G: in natural units a length, half the horizon radius of a hole of that mass. Bodies whose GM is measured keep it; this is for a mass known as a mass.
func (Length) InSolarRadii ¶
InSolarRadii is the length in the sun's radius
type LightFraction ¶
type LightFraction struct {
// contains filtered or unexported fields
}
LightFraction is a speed, as a share of light's: with the speed of light one, that is what a speed is, and it has no unit.
func (LightFraction) InKilometresPerSecond ¶
func (speed LightFraction) InKilometresPerSecond() float64
InKilometresPerSecond is the speed in km/s.
func (LightFraction) InLightFraction ¶
func (speed LightFraction) InLightFraction() float64
InLightFraction is the speed as a share of light's.
type Mass ¶
type Mass struct {
// contains filtered or unexported fields
}
Mass is a mass, held as the energy it is at rest
func Hydrogen1 ¶
func Hydrogen1() Mass
Hydrogen1 is the mass of a hydrogen 1 atom, its electron and all.
func (Mass) InSolarMasses ¶
InSolarMasses is the mass in the sun's masses
func (Mass) Minus ¶
Minus is the mass less another. Each side is rounded first, as an explicit float64 conversion does: inlined, a product that made a mass could fuse with the subtraction on arm64, and a mass less itself would leave the product's rounding behind instead of nothing.
type Nominal ¶
type Nominal struct {
// contains filtered or unexported fields
}
Nominal is a star's measures as the IAU fixes them for reference: its GM, radius and luminosity, and the mass that follows.
func Sun ¶
func Sun() Nominal
Sun is the IAU's nominal sun: its GM, radius and luminosity as the IAU fixes them, and its mass from its GM over G.
func (Nominal) Luminosity ¶
Luminosity is the star's luminosity.
type Power ¶
type Power struct {
// contains filtered or unexported fields
}
Power is energy given off over time, held in MeV squared
func BlackBody ¶
func BlackBody(heat Temperature, area Area) Power
BlackBody is the power a black surface of an area gives off at a temperature.
func Eddington ¶
Eddington is the brightest a mass can shine before its own light pushes its gas away: gravity pulling on each proton against light pushing on each electron, for gas of pure hydrogen.
Past it, a star sheds itself, and a hole's food is blown back out.
func SolarLuminosities ¶
SolarLuminosities is a power in the sun's luminosity
func (Power) InSolarLuminosities ¶
InSolarLuminosities is the power in the sun's luminosity
type Sweep ¶
type Sweep struct {
// contains filtered or unexported fields
}
Sweep is a distance crossed with a velocity: the north of the plane a body moves in, and twice the area it sweeps each moment, which kepler's second law says an orbit keeps.
type Temperature ¶
type Temperature struct {
// contains filtered or unexported fields
}
Temperature is a temperature, held as the energy k T
func SurfaceTemperature ¶
func SurfaceTemperature(power Power, area Area) Temperature
SurfaceTemperature is how hot a black surface of an area must be to give off a power: the fourth root of stefan's law, undone.
func (Temperature) InKelvin ¶
func (heat Temperature) InKelvin() float64
InKelvin is the temperature in K
func (Temperature) InMeV ¶
func (heat Temperature) InMeV() float64
InMeV is the temperature as the energy k T, in MeV
type Velocity ¶
type Velocity struct {
// contains filtered or unexported fields
}
Velocity is how fast and which way, each part a share of light's speed. Velocities here add the way slow things add; near light's speed that is wrong, and nothing here moves that fast.
func KilometresPerSecond ¶
KilometresPerSecond is a velocity of three parts in km/s. It refuses a part that is not a number, and a speed at light's or past it, and then gives no velocity.
func (Velocity) AlongX ¶
func (moving Velocity) AlongX() LightFraction
AlongX is the velocity's part along x.
func (Velocity) AlongY ¶
func (moving Velocity) AlongY() LightFraction
AlongY is the velocity's part along y, the kit's up.
func (Velocity) AlongZ ¶
func (moving Velocity) AlongZ() LightFraction
AlongZ is the velocity's part along z.
func (Velocity) Speed ¶
func (moving Velocity) Speed() LightFraction
Speed is how fast, whichever way.