unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
303 lines (302 loc) • 14.9 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a Force */
export interface ForceDto {
/** The value of the Force */
value: number;
/** The specific unit that the Force value is representing */
unit: ForceUnits;
}
/** ForceUnits enumeration */
export declare enum ForceUnits {
/** One dyne is equal to 10 micronewtons, 10e−5 N or to 10 nsn (nanosthenes) in the old metre–tonne–second system of units. */
Dyne = "Dyn",
/** The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N. */
KilogramsForce = "KilogramForce",
/** The tonne-force, metric ton-force, megagram-force, and megapond (Mp) are each 1000 kilograms-force. */
TonnesForce = "TonneForce",
/** The newton (symbol: N) is the unit of force in the International System of Units (SI). It is defined as 1 kg⋅m/s2, the force which gives a mass of 1 kilogram an acceleration of 1 metre per second per second. */
Newtons = "Newton",
/** The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N. */
KiloPonds = "KiloPond",
/** The poundal is defined as the force necessary to accelerate 1 pound-mass at 1 foot per second per second. 1 pdl = 0.138254954376 N exactly. */
Poundals = "Poundal",
/** The standard values of acceleration of the standard gravitational field (gn) and the international avoirdupois pound (lb) result in a pound-force equal to 4.4482216152605 N. */
PoundsForce = "PoundForce",
/** An ounce-force is 1⁄16 of a pound-force, or about 0.2780139 newtons. */
OunceForce = "OunceForce",
/** The short ton-force is a unit of force equal to 2,000 pounds-force (907.18474 kgf), that is most commonly used in the United States – known there simply as the ton or US ton. */
ShortTonsForce = "ShortTonForce",
/** */
Micronewtons = "Micronewton",
/** */
Millinewtons = "Millinewton",
/** */
Decanewtons = "Decanewton",
/** */
Kilonewtons = "Kilonewton",
/** */
Meganewtons = "Meganewton",
/** */
KilopoundsForce = "KilopoundForce"
}
/** In physics, a force is any influence that causes an object to undergo a certain change, either concerning its movement, direction, or geometrical construction. In other words, a force can cause an object with mass to change its velocity (which includes to begin moving from a state of rest), i.e., to accelerate, or a flexible object to deform, or both. Force can also be described by intuitive concepts such as a push or a pull. A force has both magnitude and direction, making it a vector quantity. It is measured in the SI unit of newtons and represented by the symbol F. */
export declare class Force extends BaseUnit {
protected value: number;
private dyneLazy;
private kilogramsforceLazy;
private tonnesforceLazy;
private newtonsLazy;
private kilopondsLazy;
private poundalsLazy;
private poundsforceLazy;
private ounceforceLazy;
private shorttonsforceLazy;
private micronewtonsLazy;
private millinewtonsLazy;
private decanewtonsLazy;
private kilonewtonsLazy;
private meganewtonsLazy;
private kilopoundsforceLazy;
/**
* Create a new Force.
* @param value The value.
* @param fromUnit The ‘Force’ unit to create from.
* The default unit is Newtons
*/
constructor(value: number, fromUnit?: ForceUnits);
/**
* The base value of Force is Newtons.
* This accessor used when needs a value for calculations and it's better to use directly the base value
*/
get BaseValue(): number;
/** Gets the default unit used when creating instances of the unit or its DTO */
protected get baseUnit(): ForceUnits.Newtons;
/** One dyne is equal to 10 micronewtons, 10e−5 N or to 10 nsn (nanosthenes) in the old metre–tonne–second system of units. */
get Dyne(): number;
/** The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N. */
get KilogramsForce(): number;
/** The tonne-force, metric ton-force, megagram-force, and megapond (Mp) are each 1000 kilograms-force. */
get TonnesForce(): number;
/** The newton (symbol: N) is the unit of force in the International System of Units (SI). It is defined as 1 kg⋅m/s2, the force which gives a mass of 1 kilogram an acceleration of 1 metre per second per second. */
get Newtons(): number;
/** The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N. */
get KiloPonds(): number;
/** The poundal is defined as the force necessary to accelerate 1 pound-mass at 1 foot per second per second. 1 pdl = 0.138254954376 N exactly. */
get Poundals(): number;
/** The standard values of acceleration of the standard gravitational field (gn) and the international avoirdupois pound (lb) result in a pound-force equal to 4.4482216152605 N. */
get PoundsForce(): number;
/** An ounce-force is 1⁄16 of a pound-force, or about 0.2780139 newtons. */
get OunceForce(): number;
/** The short ton-force is a unit of force equal to 2,000 pounds-force (907.18474 kgf), that is most commonly used in the United States – known there simply as the ton or US ton. */
get ShortTonsForce(): number;
/** */
get Micronewtons(): number;
/** */
get Millinewtons(): number;
/** */
get Decanewtons(): number;
/** */
get Kilonewtons(): number;
/** */
get Meganewtons(): number;
/** */
get KilopoundsForce(): number;
/**
* Create a new Force instance from a Dyne
* One dyne is equal to 10 micronewtons, 10e−5 N or to 10 nsn (nanosthenes) in the old metre–tonne–second system of units.
* @param value The unit as Dyne to create a new Force from.
* @returns The new Force instance.
*/
static FromDyne(value: number): Force;
/**
* Create a new Force instance from a KilogramsForce
* The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N.
* @param value The unit as KilogramsForce to create a new Force from.
* @returns The new Force instance.
*/
static FromKilogramsForce(value: number): Force;
/**
* Create a new Force instance from a TonnesForce
* The tonne-force, metric ton-force, megagram-force, and megapond (Mp) are each 1000 kilograms-force.
* @param value The unit as TonnesForce to create a new Force from.
* @returns The new Force instance.
*/
static FromTonnesForce(value: number): Force;
/**
* Create a new Force instance from a Newtons
* The newton (symbol: N) is the unit of force in the International System of Units (SI). It is defined as 1 kg⋅m/s2, the force which gives a mass of 1 kilogram an acceleration of 1 metre per second per second.
* @param value The unit as Newtons to create a new Force from.
* @returns The new Force instance.
*/
static FromNewtons(value: number): Force;
/**
* Create a new Force instance from a KiloPonds
* The kilogram-force, or kilopond, is equal to the magnitude of the force exerted on one kilogram of mass in a 9.80665 m/s2 gravitational field (standard gravity). Therefore, one kilogram-force is by definition equal to 9.80665 N.
* @param value The unit as KiloPonds to create a new Force from.
* @returns The new Force instance.
*/
static FromKiloPonds(value: number): Force;
/**
* Create a new Force instance from a Poundals
* The poundal is defined as the force necessary to accelerate 1 pound-mass at 1 foot per second per second. 1 pdl = 0.138254954376 N exactly.
* @param value The unit as Poundals to create a new Force from.
* @returns The new Force instance.
*/
static FromPoundals(value: number): Force;
/**
* Create a new Force instance from a PoundsForce
* The standard values of acceleration of the standard gravitational field (gn) and the international avoirdupois pound (lb) result in a pound-force equal to 4.4482216152605 N.
* @param value The unit as PoundsForce to create a new Force from.
* @returns The new Force instance.
*/
static FromPoundsForce(value: number): Force;
/**
* Create a new Force instance from a OunceForce
* An ounce-force is 1⁄16 of a pound-force, or about 0.2780139 newtons.
* @param value The unit as OunceForce to create a new Force from.
* @returns The new Force instance.
*/
static FromOunceForce(value: number): Force;
/**
* Create a new Force instance from a ShortTonsForce
* The short ton-force is a unit of force equal to 2,000 pounds-force (907.18474 kgf), that is most commonly used in the United States – known there simply as the ton or US ton.
* @param value The unit as ShortTonsForce to create a new Force from.
* @returns The new Force instance.
*/
static FromShortTonsForce(value: number): Force;
/**
* Create a new Force instance from a Micronewtons
*
* @param value The unit as Micronewtons to create a new Force from.
* @returns The new Force instance.
*/
static FromMicronewtons(value: number): Force;
/**
* Create a new Force instance from a Millinewtons
*
* @param value The unit as Millinewtons to create a new Force from.
* @returns The new Force instance.
*/
static FromMillinewtons(value: number): Force;
/**
* Create a new Force instance from a Decanewtons
*
* @param value The unit as Decanewtons to create a new Force from.
* @returns The new Force instance.
*/
static FromDecanewtons(value: number): Force;
/**
* Create a new Force instance from a Kilonewtons
*
* @param value The unit as Kilonewtons to create a new Force from.
* @returns The new Force instance.
*/
static FromKilonewtons(value: number): Force;
/**
* Create a new Force instance from a Meganewtons
*
* @param value The unit as Meganewtons to create a new Force from.
* @returns The new Force instance.
*/
static FromMeganewtons(value: number): Force;
/**
* Create a new Force instance from a KilopoundsForce
*
* @param value The unit as KilopoundsForce to create a new Force from.
* @returns The new Force instance.
*/
static FromKilopoundsForce(value: number): Force;
/**
* Gets the base unit enumeration associated with Force
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof ForceUnits;
/**
* Gets the default unit used when creating instances of the unit or its DTO
* @returns The unit enumeration value used as a default parameter in constructor and DTO methods
*/
protected static getBaseUnit(): ForceUnits.Newtons;
/**
* Create API DTO represent a Force unit.
* @param holdInUnit The specific Force unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: ForceUnits): ForceDto;
/**
* Create a Force unit from an API DTO representation.
* @param dtoForce The Force API DTO representation
*/
static FromDto(dtoForce: ForceDto): Force;
/**
* Convert Force to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: ForceUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the Force to string.
* Note! the default format for Force is Newtons.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the Force.
* @param options The ToString options, it also can be the number of fractional digits to keep that deprecated and moved to the options object. support in number will be dropped in the upcoming versions.
* @returns The string format of the Force.
*/
toString(unit?: ForceUnits, options?: number | ToStringOptions): string;
/**
* Get Force unit abbreviation.
* Note! the default abbreviation for Force is Newtons.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the Force.
* @returns The abbreviation string of Force.
*/
getUnitAbbreviation(unitAbbreviation?: ForceUnits): string;
/**
* Check if the given Force are equals to the current Force.
* @param force The other Force.
* @returns True if the given Force are equal to the current Force.
*/
equals(force: Force): boolean;
/**
* Compare the given Force against the current Force.
* @param force The other Force.
* @returns 0 if they are equal, -1 if the current Force is less then other, 1 if the current Force is greater then other.
*/
compareTo(force: Force): number;
/**
* Add the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
add(force: Force): Force;
/**
* Subtract the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
subtract(force: Force): Force;
/**
* Multiply the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
multiply(force: Force): Force;
/**
* Divide the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
divide(force: Force): Force;
/**
* Modulo the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
modulo(force: Force): Force;
/**
* Pow the given Force with the current Force.
* @param force The other Force.
* @returns A new Force instance with the results.
*/
pow(force: Force): Force;
}