UNPKG

@itwin/ecschema-metadata

Version:

ECObjects core concepts in typescript

46 lines 1.71 kB
import { Constant } from "../Metadata/Constant"; import { Unit } from "../Metadata/Unit"; /** * Class used for storing calculated conversion between two Units [[UnitConverter.calculateConversion]] and converting values from one Unit to another [[UnitConverter.evaluate]] * @internal */ export declare class UnitConversion { readonly factor: number; readonly offset: number; constructor(factor?: number, offset?: number); /** * Converts x using UnitConversion * @param x Input magnitude to be converted * @returns Output magnitude after conversion */ evaluate(x: number): number; /** * Used to invert source's UnitConversion so that it can be composed with target's UnitConversion cleanly * @internal */ inverse(): UnitConversion; /** * Combines two UnitConversions * Used to combine source's UnitConversion and target's UnitConversion for a final UnitConversion that can be evaluated * @internal */ compose(conversion: UnitConversion): UnitConversion; /** * Multiples two UnitConversions together to calculate factor during reducing * @internal */ multiply(conversion: UnitConversion): UnitConversion; /** * Raise UnitConversion's factor with power exponent to calculate factor during reducing * @internal */ raise(power: number): UnitConversion; /** @internal */ static identity: UnitConversion; /** * Returns UnitConversion with unit's numerator and denominator in factor and unit's offset in offset for reducing * @internal */ static from(unitOrConstant: Unit | Constant): UnitConversion; } //# sourceMappingURL=UnitConversion.d.ts.map