Record TDimension

Unit

Declaration

type TDimension = record

Description

Represents the physical dimension of a quantity using the SI base units.

Each field stores the integer exponent of the corresponding SI base unit. For example, a velocity has dimension m¹·s⁻¹, represented as FMeter=1, FSecond=-1 with all other exponents equal to zero. A dimensionless quantity has all exponents equal to zero.

Dimension arithmetic follows the rules of dimensional analysis:

Overview

Methods

Public function ToString: string;
Public class operator *(const ALeft: longint; ARight: TDimension): TDimension;
Public class operator *(const ALeft: TDimension; ARight: longint): TDimension;
Public class operator +(const ASelf: TDimension): TDimension;
Public class operator +(const ALeft, ARight: TDimension): TDimension;
Public class operator -(const ASelf: TDimension): TDimension;
Public class operator -(const ALeft, ARight: TDimension): TDimension;
Public class operator <>(const ALeft, ARight: TDimension): boolean;
Public class operator =(const ALeft, ARight: TDimension): boolean;
Public class operator div(const ALeft: TDimension; ARight: longint): TDimension;

Description

Methods

Public function ToString: string;

Returns a human-readable string representation of the dimension. Exponents equal to zero are omitted. Positive exponents are listed first, followed by negative ones with a / separator. Example: kg·m²·s⁻³·A⁻¹ for the dimension of electric potential.

Public class operator *(const ALeft: longint; ARight: TDimension): TDimension;

Returns the dimension scaled by an integer exponent. Each exponent is multiplied by ALeft. Used to represent the dimension of a quantity raised to an integer power, e.g. 3 * [m] = [m³].

Public class operator *(const ALeft: TDimension; ARight: longint): TDimension;

Returns the dimension scaled by an integer exponent. Each exponent is multiplied by ARight. Used to represent the dimension of a quantity raised to an integer power, e.g. [m] * 3 = [m³].

Public class operator +(const ASelf: TDimension): TDimension;

Unary plus. Returns the dimension unchanged.

Public class operator +(const ALeft, ARight: TDimension): TDimension;

Returns the sum of two dimensions, i.e. the dimension resulting from multiplying two physical quantities. Each exponent of the result equals the sum of the corresponding exponents.

Public class operator -(const ASelf: TDimension): TDimension;

Unary minus. Returns the inverse dimension. Each exponent is negated: used to represent the dimension of a reciprocal quantity.

Public class operator -(const ALeft, ARight: TDimension): TDimension;

Returns the difference of two dimensions, i.e. the dimension resulting from dividing two physical quantities. Each exponent of the result equals the difference of the corresponding exponents.

Public class operator <>(const ALeft, ARight: TDimension): boolean;

Returns True if the two dimensions differ in at least one exponent. Used internally to detect dimensional incompatibility between quantities.

Public class operator =(const ALeft, ARight: TDimension): boolean;

Returns True if all corresponding exponents of the two dimensions are equal. Two quantities are dimensionally compatible if and only if their dimensions are equal.

Public class operator div(const ALeft: TDimension; ARight: longint): TDimension;

Returns the dimension divided by an integer. Each exponent is divided by ARight. Used to represent the dimension of an integer root of a quantity, e.g. [m²] div 2 = [m].


Generated by PasDoc 1.0.4.