dimension
Stable type · Document types
Tier: stable · Kind: type · Topic: Document types
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
| not exported | not exported | not exported | Dimension | Dimension |
Julia
Julia does not export this type.
TypeScript
TypeScript does not export this type.
Python
Python does not export this type.
Rust
pub enum Dimension {
Mass,
Length,
Time,
Current,
Temperature,
Amount,
Luminosity,
Angle,
}
Base physical dimensions — the eight canonical axes shared across the
bindings (m kg s mol K A cd rad).
Angle is a full axis rather than a synonym for dimensionless, matching the
Go reference. The trigonometric functions therefore accept an angle OR a
dimensionless argument (see propagate_transcendental_dim); exp/log still
demand strict dimensionlessness.
Go
type Dimension [8]Rat
func (d Dimension) Divide(other Dimension) Dimension
func (d Dimension) Equal(other Dimension) bool
func (d Dimension) IsDimensionless() bool
func (d Dimension) Multiply(other Dimension) Dimension
func (d Dimension) Power(n int) Dimension
func (d Dimension) PowerRat(e Rat) Dimension
func (d Dimension) String() string
Dimension is a vector of RATIONAL exponents over the 7 SI base units plus radian. Index order: m, kg, s, mol, K, A, cd, rad.
Methods
func (d Dimension) Divide(other Dimension) Dimension
Divide subtracts component-wise exponents.
func (d Dimension) Equal(other Dimension) bool
Equal reports whether two dimensions denote the same exponent vector.
func (d Dimension) IsDimensionless() bool
IsDimensionless reports whether every exponent is zero.
func (d Dimension) Multiply(other Dimension) Dimension
Multiply adds component-wise exponents.
func (d Dimension) Power(n int) Dimension
Power scales each exponent by the integer n.
func (d Dimension) PowerRat(e Rat) Dimension
PowerRat scales each exponent by the rational e — the operation sqrt and a fractional literal exponent both need.
func (d Dimension) String() string
String renders a dimension vector in SI-base notation (e.g. “m*kg/s^2”, “1/s^(1/2)”).