UNPKG

triangule

Version:

a library for triangulation and other triangle calculations

119 lines (117 loc) 4.63 kB
/** * Converts an angle in degree into radian * * @param aDeg - the angle in degree * @returns the angle in radian */ declare function triDegRad(aDeg: number): number; /** * Converts an angle in radian into degree * * @param aRad - the angle in radian * @returns the angle in degree */ declare function triRadDeg(aRad: number): number; /** * Translate the angle in the range [-Pi, Pi] * * @param aRad - the input angle in radian * @returns the translated angle */ declare function triAPiPi(aRad: number): number; /** * Translate the angle in the range [0, 2*Pi] * * @param aRad - the input angle in radian * @returns the translated angle */ declare function triA02Pi(aRad: number): number; /** * Translate the angle in the range [0, Pi] * * @param aRad - the input angle in radian * @returns the translated angle */ declare function triA0Pi(aRad: number): number; /** * Translate the angle in the range [-Pi/2, Pi/2] * * @param aRad - the input angle in radian * @returns the translated angle */ declare function triAPihPih(aRad: number): number; declare enum ECheck { eError = 0, eWarn = 1, eIgnore = 2 } /** * Calculate the third angle of a triangle from the first two angles * * @param a1 - the first angle of the triangle in radian * @param a2 - the second angle of the triangle in radian * @param checkLevel - the level of check on the input angles * @returns the third angle of the triangle in radian + string-for-log */ declare function triAArA(a1: number, a2: number, checkLevel?: ECheck): [number, string]; /** * Calculate the two last lengths and one anmgle of a triangle from the first length and two angles * * @param a1 - the first angle of the triangle in radian * @param l12 - the length between the angles a1 and a2 in radian * @param a2 - the second angle of the triangle in radian * @param checkLevel - the level of check * @returns the two lengths of the triangle : l23, l31 + string-fot-log */ declare function triALArLL(a1: number, l12: number, a2: number, checkLevel?: ECheck): [number, number, string]; /** * Calculate the length l3 of a triangle from l1, a12 and l2 * * @param l1 - the first length of the triangle * @param a12 - the angle between l1 and l2 in radian * @param l2 - the second length of the triangle * @param checkLevel - the level of check * @returns the length l3 of the triangle + string-for-log */ declare function triLALrL(l1: number, a12: number, l2: number, checkLevel?: ECheck): [number, string]; /** * Calculate the length l3 of a triangle from a31, l1 and l2 * * @param a31 - the angle between l3 and l1 in radian * @param l1 - the first length of the triangle * @param l2 - the second length of the triangle * @param checkLevel - the level of check * @returns the two possible lengths of l3 of the triangle. l3 can be positive or negative + string-for-log */ declare function triALLrL(a31: number, l1: number, l2: number, checkLevel?: ECheck): [number, number, string]; /** * Calculate the length l3 and angle a12 of a triangle from a31, l1 and l2 * * @param a31 - the angle between l3 and l1 in radian * @param l1 - the first length of the triangle * @param l2 - the second length of the triangle * @param checkLevel - the level of check * @returns the two possible sets of l3, a31, a12 of the triangle [l3a, a31a, a12a, l3b, a31b, a12b] + string-for-log */ declare function triALLrLAA(a31: number, l1: number, l2: number, checkLevel?: ECheck): [number, number, number, number, number, number, string]; /** * Calculate one angle of a triangle from l1, l2, l3 * * @param l1 - the first length of the triangle * @param l2 - the second length of the triangle * @param l3 - the third length of the triangle * @param checkLevel - the level of check * @returns one angles of the triangle: a31 + string-for-log */ declare function triLLLrA(l1: number, l2: number, l3: number, checkLevel?: ECheck): [number, string]; /** * Calculate the angles a12, a23, a31 of a triangle from the lengths l1, l2 and l3 * * @param l1 - the first length of the triangle * @param l2 - the second length of the triangle * @param l3 - the third length of the triangle * @param checkLevel - the level of check * @returns the three angles a12, a23, a31 of the triangle + string-for-log */ declare function triLLLrAAA(l1: number, l2: number, l3: number, checkLevel?: ECheck): [number, number, number, string]; export { ECheck, triA02Pi, triA0Pi, triAArA, triALArLL, triALLrL, triALLrLAA, triAPiPi, triAPihPih, triDegRad, triLALrL, triLLLrA, triLLLrAAA, triRadDeg };