unitsnet-js
Version:
A better way to hold unit variables and easily convert to the destination unit
315 lines (314 loc) • 10.3 kB
TypeScript
import { BaseUnit, ToStringOptions } from "../base-unit";
/** API DTO represents a Angle */
export interface AngleDto {
/** The value of the Angle */
value: number;
/** The specific unit that the Angle value is representing */
unit: AngleUnits;
}
/** AngleUnits enumeration */
export declare enum AngleUnits {
/** */
Radians = "Radian",
/** */
Degrees = "Degree",
/** */
Arcminutes = "Arcminute",
/** */
Arcseconds = "Arcsecond",
/** */
Gradians = "Gradian",
/** */
NatoMils = "NatoMil",
/** */
Revolutions = "Revolution",
/** */
Tilt = "Tilt",
/** */
Nanoradians = "Nanoradian",
/** */
Microradians = "Microradian",
/** */
Milliradians = "Milliradian",
/** */
Centiradians = "Centiradian",
/** */
Deciradians = "Deciradian",
/** */
Nanodegrees = "Nanodegree",
/** */
Microdegrees = "Microdegree",
/** */
Millidegrees = "Millidegree"
}
/** In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle. */
export declare class Angle extends BaseUnit {
protected value: number;
private radiansLazy;
private degreesLazy;
private arcminutesLazy;
private arcsecondsLazy;
private gradiansLazy;
private natomilsLazy;
private revolutionsLazy;
private tiltLazy;
private nanoradiansLazy;
private microradiansLazy;
private milliradiansLazy;
private centiradiansLazy;
private deciradiansLazy;
private nanodegreesLazy;
private microdegreesLazy;
private millidegreesLazy;
/**
* Create a new Angle.
* @param value The value.
* @param fromUnit The ‘Angle’ unit to create from.
* The default unit is Degrees
*/
constructor(value: number, fromUnit?: AngleUnits);
/**
* The base value of Angle is Degrees.
* 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(): AngleUnits.Degrees;
/** */
get Radians(): number;
/** */
get Degrees(): number;
/** */
get Arcminutes(): number;
/** */
get Arcseconds(): number;
/** */
get Gradians(): number;
/** */
get NatoMils(): number;
/** */
get Revolutions(): number;
/** */
get Tilt(): number;
/** */
get Nanoradians(): number;
/** */
get Microradians(): number;
/** */
get Milliradians(): number;
/** */
get Centiradians(): number;
/** */
get Deciradians(): number;
/** */
get Nanodegrees(): number;
/** */
get Microdegrees(): number;
/** */
get Millidegrees(): number;
/**
* Create a new Angle instance from a Radians
*
* @param value The unit as Radians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromRadians(value: number): Angle;
/**
* Create a new Angle instance from a Degrees
*
* @param value The unit as Degrees to create a new Angle from.
* @returns The new Angle instance.
*/
static FromDegrees(value: number): Angle;
/**
* Create a new Angle instance from a Arcminutes
*
* @param value The unit as Arcminutes to create a new Angle from.
* @returns The new Angle instance.
*/
static FromArcminutes(value: number): Angle;
/**
* Create a new Angle instance from a Arcseconds
*
* @param value The unit as Arcseconds to create a new Angle from.
* @returns The new Angle instance.
*/
static FromArcseconds(value: number): Angle;
/**
* Create a new Angle instance from a Gradians
*
* @param value The unit as Gradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromGradians(value: number): Angle;
/**
* Create a new Angle instance from a NatoMils
*
* @param value The unit as NatoMils to create a new Angle from.
* @returns The new Angle instance.
*/
static FromNatoMils(value: number): Angle;
/**
* Create a new Angle instance from a Revolutions
*
* @param value The unit as Revolutions to create a new Angle from.
* @returns The new Angle instance.
*/
static FromRevolutions(value: number): Angle;
/**
* Create a new Angle instance from a Tilt
*
* @param value The unit as Tilt to create a new Angle from.
* @returns The new Angle instance.
*/
static FromTilt(value: number): Angle;
/**
* Create a new Angle instance from a Nanoradians
*
* @param value The unit as Nanoradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromNanoradians(value: number): Angle;
/**
* Create a new Angle instance from a Microradians
*
* @param value The unit as Microradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromMicroradians(value: number): Angle;
/**
* Create a new Angle instance from a Milliradians
*
* @param value The unit as Milliradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromMilliradians(value: number): Angle;
/**
* Create a new Angle instance from a Centiradians
*
* @param value The unit as Centiradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromCentiradians(value: number): Angle;
/**
* Create a new Angle instance from a Deciradians
*
* @param value The unit as Deciradians to create a new Angle from.
* @returns The new Angle instance.
*/
static FromDeciradians(value: number): Angle;
/**
* Create a new Angle instance from a Nanodegrees
*
* @param value The unit as Nanodegrees to create a new Angle from.
* @returns The new Angle instance.
*/
static FromNanodegrees(value: number): Angle;
/**
* Create a new Angle instance from a Microdegrees
*
* @param value The unit as Microdegrees to create a new Angle from.
* @returns The new Angle instance.
*/
static FromMicrodegrees(value: number): Angle;
/**
* Create a new Angle instance from a Millidegrees
*
* @param value The unit as Millidegrees to create a new Angle from.
* @returns The new Angle instance.
*/
static FromMillidegrees(value: number): Angle;
/**
* Gets the base unit enumeration associated with Angle
* @returns The unit enumeration that can be used to interact with this type
*/
protected static getUnitEnum(): typeof AngleUnits;
/**
* 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(): AngleUnits.Degrees;
/**
* Create API DTO represent a Angle unit.
* @param holdInUnit The specific Angle unit to be used in the unit representation at the DTO
*/
toDto(holdInUnit?: AngleUnits): AngleDto;
/**
* Create a Angle unit from an API DTO representation.
* @param dtoAngle The Angle API DTO representation
*/
static FromDto(dtoAngle: AngleDto): Angle;
/**
* Convert Angle to a specific unit value.
* @param toUnit The specific unit to convert to
* @returns The value of the specific unit provided.
*/
convert(toUnit: AngleUnits): number;
private convertFromBase;
private convertToBase;
/**
* Format the Angle to string.
* Note! the default format for Angle is Degrees.
* To specify the unit format set the 'unit' parameter.
* @param unit The unit to format the Angle.
* @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 Angle.
*/
toString(unit?: AngleUnits, options?: number | ToStringOptions): string;
/**
* Get Angle unit abbreviation.
* Note! the default abbreviation for Angle is Degrees.
* To specify the unit abbreviation set the 'unitAbbreviation' parameter.
* @param unitAbbreviation The unit abbreviation of the Angle.
* @returns The abbreviation string of Angle.
*/
getUnitAbbreviation(unitAbbreviation?: AngleUnits): string;
/**
* Check if the given Angle are equals to the current Angle.
* @param angle The other Angle.
* @returns True if the given Angle are equal to the current Angle.
*/
equals(angle: Angle): boolean;
/**
* Compare the given Angle against the current Angle.
* @param angle The other Angle.
* @returns 0 if they are equal, -1 if the current Angle is less then other, 1 if the current Angle is greater then other.
*/
compareTo(angle: Angle): number;
/**
* Add the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
add(angle: Angle): Angle;
/**
* Subtract the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
subtract(angle: Angle): Angle;
/**
* Multiply the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
multiply(angle: Angle): Angle;
/**
* Divide the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
divide(angle: Angle): Angle;
/**
* Modulo the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
modulo(angle: Angle): Angle;
/**
* Pow the given Angle with the current Angle.
* @param angle The other Angle.
* @returns A new Angle instance with the results.
*/
pow(angle: Angle): Angle;
}